VB icon

Use of the Toolbar Control

Submitted on: 1/1/2015 11:35:00 AM
By: Found on the World Wide Web (from psc cd)  
Level: Not Given
User Rating: By 3 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 644
     Short tutorial on how to use the toolbar in VB4/5 32 bit.
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
' Name: Use of the Toolbar Control
' Description:Short tutorial on how to use the toolbar in VB4/5 32 bit.
' By: Found on the World Wide Web (from psc cd)

'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!

Other 14 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.