本文整理汇总了C#中System.Windows.Forms.ToolStripDropDownItem类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripDropDownItem类的具体用法?C# ToolStripDropDownItem怎么用?C# ToolStripDropDownItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripDropDownItem类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripDropDownItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: maakHelpMenu
private void maakHelpMenu()
{
ToolStripDropDownItem menu;
menu = new ToolStripMenuItem("Help");
menu.DropDownItems.Add("Over \"Schets\"", null, this.about);
menuStrip.Items.Add(menu);
}
示例2: ToolStripDropDownItemProvider
public ToolStripDropDownItemProvider (ToolStripDropDownItem dropDrownItem) :
base (dropDrownItem)
{
this.dropDrownItem = dropDrownItem;
itemProviders = new Dictionary<ToolStripItem, FragmentControlProvider> ();
}
示例3: DynamicMenu
// Constructor required by plugins
public DynamicMenu(ToolStripDropDownItem tsmiHost)
{
Debug.Assert(tsmiHost != null);
if(tsmiHost == null) throw new ArgumentNullException("tsmiHost");
m_tsicHost = tsmiHost.DropDownItems;
}
示例4: CreateGroupItems
public static List<ToolStripItem> CreateGroupItems(ToolStripDropDownItem dropDownItem)
{
List<ToolStripItem> ret = new List<ToolStripItem>();
DropDownMenuReorderable dropDown = null;
if(dropDownItem != null) {
dropDown = (DropDownMenuReorderable)dropDownItem.DropDown;
while(dropDown.Items.Count > 0) {
dropDown.Items[0].Dispose();
}
dropDown.ItemsClear();
}
const string key = "groups";
foreach(Group group in GroupsManager.Groups) {
if(group.Paths.Count == 0 || !QTUtility2.PathExists(group.Paths[0])) continue;
QMenuItem item = new QMenuItem(group.Name, MenuGenre.Group);
item.SetImageReservationKey(group.Paths[0], null);
if(dropDown != null) {
dropDown.AddItem(item, key);
}
ret.Add(item);
if(!group.Startup) continue;
if(StartUpTabFont == null) {
StartUpTabFont = new Font(item.Font, FontStyle.Underline);
}
item.Font = StartUpTabFont;
}
if(dropDownItem != null) {
dropDownItem.Enabled = dropDown.Items.Count > 0;
}
return ret;
}
示例5: AddSubMenuNodes
private void AddSubMenuNodes(IEnumerable<ConnectionInfo> nodes, ToolStripDropDownItem toolStripMenuItem)
{
foreach (var connectionInfo in nodes)
{
var newItem = CreateMenuItem(connectionInfo);
toolStripMenuItem.DropDownItems.Add(newItem);
}
}
示例6: Endisable
private static void Endisable(ToolStripDropDownItem tsddi, bool enable, PropagationMode mode) {
if((mode & PropagationMode.CHILDREN) == PropagationMode.CHILDREN) {
foreach(ToolStripItem tsi in tsddi.DropDownItems) {
Endisable(tsi, enable, PropagationMode.CHILDREN);
}
}
tsddi.Enabled = enable;
}
示例7: HookItem
private void HookItem(ToolStripDropDownItem t)
{
t.Click += SubHook;
t.Tag = this;
if (!t.HasDropDownItems) return;
foreach (ToolStripMenuItem item in t.DropDownItems)
{
HookItem(item);
}
}
示例8: OpenWithMenu
public OpenWithMenu(ToolStripDropDownItem tsmiHost)
{
if(tsmiHost == null) { Debug.Assert(false); return; }
m_tsmiHost = tsmiHost;
m_dynMenu = new DynamicMenu(m_tsmiHost);
m_dynMenu.MenuClick += this.OnOpenUrl;
m_tsmiHost.DropDownOpening += this.OnMenuOpening;
}
示例9: AddBodyGlyphs
private void AddBodyGlyphs(ToolStripDropDownItem item)
{
if ((item != null) && (((ToolStripMenuItemDesigner) this.designerHost.GetDesigner(item)) != null))
{
foreach (ToolStripItem item2 in item.DropDownItems)
{
this.AddItemBodyGlyph(item2);
}
}
}
示例10: UpdateDropDownText
protected void UpdateDropDownText(ToolStripDropDownItem dropDownItem, object ItemTag)
{
foreach (ToolStripItem item in dropDownItem.DropDownItems)
{
if (ItemTag.Equals(item.Tag))
{
dropDownItem.Text = item.Text;
break;
}
}
}
示例11: PerformDropDownClick
protected static void PerformDropDownClick(ToolStripDropDownItem dropDownItem, object ItemTag)
{
foreach (ToolStripItem item in dropDownItem.DropDownItems)
{
if (ItemTag.Equals(item.Tag))
{
item.PerformClick();
break;
}
}
}
示例12: MruController
public MruController(string subKeyName, ToolStripDropDownItem recentMenu, EventHandler onItemClick)
{
if (string.IsNullOrWhiteSpace(subKeyName))
throw new ArgumentNullException("subKeyName");
if (recentMenu == null)
throw new ArgumentNullException("parentMenuItem");
if (onItemClick == null)
throw new ArgumentNullException("onItemClick");
SubKeyName = string.Concat(@"Software\", subKeyName);
RecentMenu = recentMenu;
OnItemClick = onItemClick;
RefreshRecentMenu();
}
示例13: CheckDropDownBounds
private bool CheckDropDownBounds(ToolStripDropDownItem dropDownItem, Glyph childGlyph, GlyphCollection glyphs)
{
if (dropDownItem == null)
{
return false;
}
Rectangle bounds = childGlyph.Bounds;
Rectangle rect = base.BehaviorService.ControlRectInAdornerWindow(dropDownItem.DropDown);
if (!bounds.IntersectsWith(rect))
{
glyphs.Insert(0, childGlyph);
}
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:ToolStripContainerDesigner.cs
示例14: RecursiveMenuItems
private void RecursiveMenuItems(ToolStripDropDownItem item)
{
if (item.HasDropDownItems)
{
foreach (var cItem in item.DropDownItems)
{
if (cItem is ToolStripMenuItem)
{
RecursiveMenuItems((ToolStripMenuItem)cItem);
}
}
}
SetColorsOnMenuItem((ToolStripMenuItem)item);
}
示例15: GetAllDbData
internal static void GetAllDbData(ToolStripDropDownItem toolStripMenu)
{
using (UPdatabase ctx = new UPdatabase())
{
var allRows = ctx.UpData.ToList();
if (toolStripMenu.DropDownItems.Count != 0)
{
toolStripMenu.DropDownItems.Clear();
}
foreach (var name in allRows)
{
toolStripMenu.DropDownItems.Add(name.ID + "-" + name.UserName, null, myClickHandler);
item = ctx.UpData.FirstOrDefault(s => s.UserName == name.UserName);
}
}
}