我试图弄清楚如何使用我添加到工具条中的项目。下面是我正在使用的代码,我在工具条中添加了几个项目“test1,test2”,但是如何选择它们并添加点击事件的代码?
谢谢。
Public Class MenuStripCustom
Inherits MenuStrip
Private WithEvents NavToolStrip As New ToolStripMenuItem("File")
Sub New()
Dim tsi As New ToolStripMenuItem
Dim tsi2 As New ToolStripDropDownButton
Me.Items.Add(NavToolStrip)
NavToolStrip.DropDownItems.Add("test1")
NavToolStrip.DropDownItems.Add("test2")
End Sub
Private Sub NavToolStripDropDownButton_Click(sender As Object, e As EventArgs) Handles NavToolStrip.DropDownItemClicked
' What do I put here to handle different drop down items?
' ie. select case (dropDownItem)
' case: test1?
End Sub
结束类