|
-
Nov 22nd, 2002, 11:07 AM
#1
Thread Starter
Hyperactive Member
Toolbar - 'key' selection *[RESOLVED]*
How can I capture which button is pressed on a toolbar, besides using (the bold bit):
VB Code:
Select Case ToolBar1.Buttons.[b]IndexOf(e.Button)[/b]
Case 0
.....
I want to get the name of the button ("save", "load", "new", etc) in case I add / insert buttons later, otherwise i'd have to change all the case statements!
VB 6 had a unique key, but I can't seem to find that on VB .NET?
Last edited by RealNickyDude; Nov 25th, 2002 at 05:59 PM.
-
Nov 22nd, 2002, 11:31 AM
#2
You can use the tag property.
-
Nov 22nd, 2002, 06:19 PM
#3
Thread Starter
Hyperactive Member
How exactly?
VB Code:
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Select Case ToolBar1.Buttons.?????
End Select
-
Nov 22nd, 2002, 06:35 PM
#4
If you have something set as the button tag then you can do this:
VB Code:
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Select Case e.Button.Tag
End Select
-
Nov 23rd, 2002, 06:45 AM
#5
Thread Starter
Hyperactive Member
Thanks Edneeis
(I really should get myself more books!)
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
|