本文主要是介绍ContextMenuStrip 中添加子菜单,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ContextMenuStrip 中添加二级菜单
代码如下:
Dim AAA As Windows.Forms.ContextMenuStrip = New Windows.Forms.ContextMenuStrip()
Dim BBB As ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Dim CCC As ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
CCC.Name = " CCC "
CCC.Text = " CCC "
BBB.Name = " BBB "
BBB.Text = " BBB "
BBB.DropDownItems.AddRange( New ToolStripItem() {CCC})
AAA.Items.Add(BBB)
Me .ContextMenuStrip = AAA
Dim BBB As ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Dim CCC As ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
CCC.Name = " CCC "
CCC.Text = " CCC "
BBB.Name = " BBB "
BBB.Text = " BBB "
BBB.DropDownItems.AddRange( New ToolStripItem() {CCC})
AAA.Items.Add(BBB)
Me .ContextMenuStrip = AAA
这篇关于ContextMenuStrip 中添加子菜单的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!