Toolbar - Active X Control

by Linda Quinn

Close Window


Processing the Toolbar Click Event
Private Sub tbrAll_ButtonClick(ByVal Button As MSComCtlLib.Button)

Select Case Button.Key
Case "New"
newCourse
Case "Open"
Case "Save"
saveCourse
Case "Print"
Case "Find"
frmFind.Show
Case "SortA"
BuildList sby, ""
Case "SortD"
BuildList sby & "DESC", ""
Case "Help"
MsgBox "No HELP available."
End Select

End Sub


Disabling buttons
Private Sub toolsetup()
toolbar1.Buttons.Item(7).Enabled = False
toolbar1.Buttons.Item(8).Enabled = False
toolbar1.Buttons("Print").Enabled = False
toolbar1.Buttons("Undo").Enabled = False
End Sub


Common Properties
Index Index of the button in the button objects collection
Caption A caption added to the face of the button.
This will change the size of smaller buttons.
Key The name assigned to each button.
This can be used to select a specific button.
It is more accurate than Index since the index number can change.
Value The values are tbrUnPressed and tbrPressed.
ToolTipText This is displayed when cursor hovers over the button.
Image The Index or Key of the image in the associated ImageList.
Tag Any value can be entered in the Tag field. This can be used as a flag or reference.


Button Styles
Default This is the standard button.
Check This is a toggle button. When pressed, it stays depressed. When pressed again, it becomes unpressed.
ButtonGroup Groups selected buttons together, so that pressing one caused the others to be unselected.
Separator Blank space between buttons
PlaceHolder Allows a program created control, such as a combo box, on the toolbar.
DropDown A button menu can be inserted here.



=================================================================
This content was created by Linda Quinn of LQNet.

See http://www.lqnet.com for a great collection of articles on this and other topics.

=================================================================
Copyright © 2006-2008, LQ Systems,Inc. All rights reserved.


====================================================================
Want an expert to help with your project?    LQ Systems, Inc.   Business Solutions
====================================================================