本文整理汇总了C#中System.Windows.Forms.ToolStripDropDownItem.ToolStripDropDownItem构造函数的典型用法代码示例。如果您正苦于以下问题:C# ToolStripDropDownItem构造函数的具体用法?C# ToolStripDropDownItem怎么用?C# ToolStripDropDownItem使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。您也可以进一步了解该构造函数所在类System.Windows.Forms.ToolStripDropDownItem
的用法示例。
在下文中一共展示了ToolStripDropDownItem构造函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeToolStripDropDownItems
// This utility method creates and initializes three
// ToolStripDropDownItem controls and adds them
// to the form's ToolStrip control.
private void InitializeToolStripDropDownItems()
{
ToolStripDropDownButton b = new ToolStripDropDownButton("DropDownButton");
b.DropDown = this.contextMenuStrip1;
b.DropDownClosed += new EventHandler(toolStripDropDownItem_DropDownClosed);
b.DropDownItemClicked += new ToolStripItemClickedEventHandler(toolStripDropDownItem_DropDownItemClicked);
b.DropDownOpened += new EventHandler(toolStripDropDownItem_DropDownOpened);
ToolStripMenuItem m = new ToolStripMenuItem("MenuItem");
m.DropDown = this.contextMenuStrip1;
m.DropDownClosed += new EventHandler(toolStripDropDownItem_DropDownClosed);
m.DropDownItemClicked += new ToolStripItemClickedEventHandler(toolStripDropDownItem_DropDownItemClicked);
m.DropDownOpened += new EventHandler(toolStripDropDownItem_DropDownOpened);
ToolStripSplitButton sb = new ToolStripSplitButton("SplitButton");
sb.DropDown = this.contextMenuStrip1;
sb.DropDownClosed += new EventHandler(toolStripDropDownItem_DropDownClosed);
sb.DropDownItemClicked += new ToolStripItemClickedEventHandler(toolStripDropDownItem_DropDownItemClicked);
sb.DropDownOpened += new EventHandler(toolStripDropDownItem_DropDownOpened);
this.toolStrip1.Items.AddRange(new ToolStripItem[] { b, m, sb });
}