Newbie with .NET environment - toolbarbutton click help required

G

Guest

Hi All,

I have drag and dropped a toolbar on to my form and then chose button collection from the properties and clicked on add to add toolbar buttons. However, I am not able to get to the code window of toolbar button click. How can I achieve this?

Regards.
 
C

Cor Ligthert

Hi SM,

In the toolbar there is a collection, there you can set the buttons using
the designer.

I hope this helps?

Cor
 
G

Guest

Thanks for the response. I am able to define buttons through the buttons collection. But, I don't know how to define code for the toolbar button click.
 
C

Cor Ligthert

Hi SM,

I use for that this
\\\
Toolbar event
Select case e.button.Tag
case mybutton1
case mybutton2
End Select
///
I hope this helps?

Cor
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?c20=?= said:
I have drag and dropped a toolbar on to my form and then chose button
collection from the properties and clicked on add to add toolbar
buttons. However, I am not able to get to the code window of toolbar
button click.

\\
Private Sub ToolBar1_ButtonClick( _
ByVal sender As Object, _
ByVal e As ToolBarButtonClickEventArgs _
) Handles ToolBar1.ButtonClick
Select Case True
Case e.Button Is Me.ToolBarButton1
 
G

Guest

Thanks for the post.

For a normal button click, to go to the event handler, I double-click on the button in the form designer and I would automatically be taken to the event handler for the button click. In case of the toolbar button, I am not able to do this, since I am not able to bring focus to the toolbar button. When I place the mouse pointer on the toolbar button and double-click, I am being taken to toolbar click event handler.

How can I go the event handler of the toolbar button from the form designer window?

Regards
 

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