|
-
Jul 6th, 2002, 03:36 PM
#1
*resolved* what's the right way to check for toolbar buttons when clicked
right now I'm checking the tag property , what would be a good way to find out what button is clicked. I dont want to use if e.button = myToolBarButton because I'm using a select case statement and it doesnt let me to use e.button for my case....
any ideas?
Last edited by MrPolite; Jul 6th, 2002 at 06:52 PM.
-
Jul 6th, 2002, 06:13 PM
#2
This sample is from the MSDN Library site...
VB Code:
Protected Sub toolBar1_ButtonClick(sender As Object, _
e As ToolBarButtonClickEventArgs)
' Evaluate the Button property to determine which button was clicked.
Select Case toolBar1.Buttons.IndexOf(e.Button)
Case 0
openFileDialog1.ShowDialog()
' Insert code to open the file.
Case 1
saveFileDialog1.ShowDialog()
' Insert code to save the file.
Case 2
printDialog1.ShowDialog()
' Insert code to print the file.
End Select
End Sub
Here is the link:
http://www.msdn.microsoft.com/librar...clicktopic.asp
-
Jul 6th, 2002, 06:52 PM
#3
I might change the buttons every now and then, so I think I'll just save the button name in the tag and then I check for the tag property...
tnx for the help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|