by Found on the World Wide Web (15 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (3 Votes)
Short tutorial on how to use the toolbar in VB4/5 32 bit. https://137.56.41.168:2080/VisualBasicSource/vb4toolbar.txt
'first be sure you have add the custom controls
'Microsoft Windows Common Controls -> Comctl32.ocx
'step 1:
'add the control Imagelist
'set the propertie Custom
'General: size
'Images: click 'Insert Picture' to add the necessary pictures
'step 2:
'add the control Toolbar
'set the propertie Custom
'General: Imagelist
'Buttons: to add a button just click on 'Insert Button'
'at 'Image' you need to set the index-number of the wanted picture
'this number is the same as the pictures index in the ImageList
'place - if you want - a ToolTipText
'or if you just want text place it behind the propertie 'Caption'
'click on 'OKE' when you are finished
'and the toolbar is ready
'now the code
'put it under the
Private Sub Toolbar1_ButtonClick(ByVal Button As Button)
Select Case Button.Index
Case 1 'click on the first button
Case 2 'click on the second button
Case 3 'click on the third button
'and so on
End Select
End Sub
'you can change most properties a runtime
Toolbar1.Buttons(1).Visible = False 'makes the first button disappear
Toolbar1.Buttons(1).ToolTipText = "an other one" 'change the tooltip text of the first button
Toolbar1.Buttons(2).Enabled = False 'disable the second button
Toolbar1.Buttons(3).Caption = "KATHER" 'change the caption of the third button
'BTW you cannot set the property Toolbar1.ShowTips at runtime!