A
Adam Honek
Hi,
I have a toolstrip on a form.
One of the parts that comprise this toolstrip is a ToolStripDropDownButton
I'm trying to catch these events but somehow it's not working how. I'm using
the code below.
How do I do it? I am right converting it into a ToolStripDropDownButton
aren't I?
Option1, 2, 3 are the names of the ToolStripMenuItem that belong (drop down
from) the ToolStripDropDownButton.
Thanks,
Adam
Private Sub Option1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Option2.Click, _
Option3.Click
'************************************************************
' +++ Purpose
'************************************************************
' Handles the click event for each tool menu item
'************************************************************
'Declare an object of type ToolStripMenuItem
Dim pMenuStripItem As ToolStripDropDownButton
'Now let's find out which menu item was clicked
pMenuStripItem = CType(sender, ToolStripDropDownButton)
'Each item corresponds to a different feature
Select Case pMenuStripItem.Name
'//1
Case "Option1"
MsgBox("ssdsdd")
'//2
Case "Option2"
'//3
Case "Option3"
End Select
End Sub
I have a toolstrip on a form.
One of the parts that comprise this toolstrip is a ToolStripDropDownButton
I'm trying to catch these events but somehow it's not working how. I'm using
the code below.
How do I do it? I am right converting it into a ToolStripDropDownButton
aren't I?
Option1, 2, 3 are the names of the ToolStripMenuItem that belong (drop down
from) the ToolStripDropDownButton.
Thanks,
Adam
Private Sub Option1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Option2.Click, _
Option3.Click
'************************************************************
' +++ Purpose
'************************************************************
' Handles the click event for each tool menu item
'************************************************************
'Declare an object of type ToolStripMenuItem
Dim pMenuStripItem As ToolStripDropDownButton
'Now let's find out which menu item was clicked
pMenuStripItem = CType(sender, ToolStripDropDownButton)
'Each item corresponds to a different feature
Select Case pMenuStripItem.Name
'//1
Case "Option1"
MsgBox("ssdsdd")
'//2
Case "Option2"
'//3
Case "Option3"
End Select
End Sub