|
-
Jun 29th, 2005, 10:46 PM
#1
Thread Starter
Junior Member
Reusing same command button
I have a form in visual basic that has four tabs. I have different command buttons on each tab that does different things.
I need to reuse few buttons in all of the tab, how can I reuse it.
Thanks
Dali
-
Jun 29th, 2005, 10:52 PM
#2
New Member
Re: Reusing same command button
What doyou mean by reuse? Like if you click it, you can click it again later?
-
Jun 30th, 2005, 05:47 AM
#3
Re: Reusing same command button
For the buttons that you want to use, take them off the tabs, and put them on the form itself. Then, depending on which tab is active, the button will do different things. Example:
VB Code:
Private Sub Command1_Click()
'this is only an example. you can have the button run different
'sub routines instead of displaying a message box
Select Case SSTab1.Tab
Case 0
MsgBox "You are on the first tab"
Case 1
MsgBox "You are on the second tab"
Case 2
MsgBox "You are on the third tab"
End Select
End Sub
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
|