ContextMenuStrip 的小问题
在ContextMenuStrip 怎么添加二级菜单?
例如 Dim popMenu As New ContextMenuStrip
popMenu.Items.Add( "1111111 ") 是添加1级菜单
如何加2级的 请指教!
[解决办法]
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