|
-
Jul 10th, 2000, 09:33 PM
#1
Thread Starter
Lively Member
Is it posible to create new buttons for toolbars and tabstrips during run-time?
-
Jul 11th, 2000, 12:47 AM
#2
Fanatic Member
Nope, I think...
Dear ThinH,
If you are asking about run-time adding control, then, I think you can't do anything when you run your VB coding. Because, I think, you can only add control, or something like that, in Design time.
In run-time, you can only add some code (code that will not effect the whole project). But, if you'd like to add the code that will affect the whole project, then I think you should stop your run-time first.
Hope will help,
Regards,
Wen Lie
-
Jul 12th, 2000, 03:11 PM
#3
Frenzied Member
Yes you can!
This snippet of code should show you how to do it.
The trick party is determining which button was pressed the Toolbar1_ButtonClick event.
If the order in which button as are loaded is variable it would be best to load a unique key for each button and use a "select" on button.key so the order of the buttons on the toolbar doesn't matter
Code:
Option Explicit
Private Sub Command1_Click()
Dim btnX As Button
Set btnX = Toolbar1.Buttons.Add
End Sub
Private Sub Command2_Click()
TabStrip1.Tabs.Add
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
MsgBox "button " & Button.Index & " was pressed"
Select Case Button.Index
Case 1
Case 2
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
|