Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling toolbar Click event from code

Status
Not open for further replies.

olichap

Programmer
Mar 20, 2001
389
US
Anyone know how to call the toolbar button click event from code (and pass it something as either "sender" or "e" that tells the event handler which button I'm dealing with)?



Thanks,

O.
 
This code can help you to call toolbar's button click event.

here you can give keyname or index values for your individual buttons on your toolbar.

Private Sub tbToolBar_ButtonClick(ByVal Button As MSComCtlLib.Button)
Select Case Button.Key
Case "keyname1"
execute statements1
Case "keyname2"
execute statements2
............

End Select
End Sub

SS
 
Thanks SS27 but that's the code for VB6; got that covered.

I'm looking for the VB.NET equivalent of:

Call tbToolBar_buttonclick(buttonVar)

I'm trying to call the click event in a .NET toolbar without actually clicking a button.

O.
 
Found the answer in another group:

Call Me.tbrName_ButtonClick(tbrName, New ToolBarButtonClickEventArgs(Me.tbutSave))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top