Home All Groups Group Topic Archive Search About

ToolStripDropDownButton event

Author
6 May 2006 5:31 PM
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

Author
8 May 2006 9:55 AM
Larry Lard
Adam Honek wrote:
Show quoteHide quote
> 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

Shouldn't this be handling Option1.Click as well ?

--
Larry Lard
Replies to group please