ToolStripDropDownButton event

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
 
L

Larry Lard

Adam said:
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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top