Control - Tool Bar

images\btn_ctrl_toolbar.gif Creates a customizable toolbar at the top of the form that hosts buttons or other controls. Toolbars contain a collection of Button objects. Button objects created using PlaceHolder style can reserve space on the toolbar for other controls, like ComboBox controls.

 

Buttons can have text, images or both. Images are fetched from an ImageList control collection. Buttons are programmed by adding code to the ButtonClick event for each button.

 

Buttons may even have menus within them when the button uses Dropdown style. Each button in the Buttons collection can itself have a collection of ButtonMenu objects.

 

Note: Non-Common Control properties are prefaced with "tbr", suppressed in the following for greater legibility.

 

Properties

 

In addition to the properties listed below, a Control tab provides access to certain frequently used form properties for this control. See the Form Properties topic for information on those properties.

 

 

ToolBar

General

 

MousePointer

The type of mouse pointer displayed when over the Toolbar. Choose from 16 different types plus a custom pointer

OLEDropMode

Set to None (default) if the Toolbar does not accept OLE drops and is to display the No Drop cursor if an OLE drop is attempted. Set to Manual, the Toolbar will trigger OLE drop events, allowing programs to handle the OLE drop operation in code.

ImageList

ImageList to use for buttons in normal mode.

DisabledImageList

ImageList to use for disabled buttons.

HotImageList

ImageList for "hot" images: appear on button on mouse hover when Style is Transparent.

HelpContextID

Context ID for this control to use for this toolbar.

ButtonHeight

Height of button. Updated to accommodate string in Caption property or image in Image property for the button.

ButtonWidth

Width of button. Updated to accommodate string in Caption property or image in Image property for the button.

Appearance

3D or Flat. 3D is the standard Windows look. Flat has no effect with command buttons.

Text Alignment

Position of text relative to button. TextAlignbottom or TextAlignRight

Style

Standard or Flat, the appearance of the toolbar control as either a "3D" look or as a flat look.

HelpFile

A filename for path and filename of the help file to use with this toolbar.

AllowCustomize

True - allow user to customize toolbar by double clicking on it. False - no user customization allowed.

ShowTips

True (Default) - Show ToolTipsText. False - Don't.

Wrappable

True - buttons wrap if form resized. False - No wrapping.

Enabled

True or False. True means the object can respond to user-generated events, false prevents it from responding.

BorderStyle

FixedSingle (default) or None.

 

 

Buttons

 

Index

Integer that uniquely identifies a button object in the Toolbar collection. Numbered in order of creation from the first button object, which is always 1.

Caption

Text for button caption.

Key

A unique string that identifies each button object.

Style

Specify button behavior:

Default

Standard toolbar button click and it bounces back.

Check

Used for toggles/mode buttons. Pushed in and stays in until pushed out.

ButtonGroup

Allows only one button in the group to be pushed in.

Separator

No function. A spacer of eight pixels.

Placeholder

Reserves space into which other controls can be placed.

Dropdown

Enables use of button menu on this button. Creates a small down arrow to indicate the presence of a dropdown menu.

 

 

ToolTipText

Tool tip text to display as tool tip for this button.

Tag

Stores a string available for the programmer to use as desired. Often used to store an identification string of some sort.

Visible

True - Button is visible. False - It isn't.

Enabled

True or False. True means the button can respond to user-generated events, false prevents it from responding.

MixedState

Dithers the images on the button to be used to display indeterminate states associated with that button.

Description

Description that will appear for this button when the Customize Toolbar dialog is invoked.

Value

Pressed or Unpressed.

Width (Placeholder)

Width to use for placeholder Style buttons.

Image

Image number from ImageList.

 

 

ButtonMenus

 

Index

Integer that uniquely identifies a ButtonMenu object in the button menu collection. Numbered in order of creation from the first ButtonMenu object, which is always 1.

Text

Text for menu item.

Key

A unique string that identifies each ButtonMenu object.

Tag

Stores a string available for the programmer to use as desired. Often used to store an identification string of some sort.

Enabled

True or False. True means the button can respond to user-generated events, false prevents it from responding.

Visible

True - Button is visible. False - It isn't.

 

 

Picture

 

MouseIcon

Custom icon to use when the MousePointer property is set to 99. Like Visual Basic, will not load animated cursor (.ani) files.