Visual Basic > Windows and Controls
Use of the Toolbar Control
Use of the Toolbar Control 'using a toolbar (vb4/32) '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! Return
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows