Click or drag to resize

ToolBar.InsertItem Method

X#
Insert a new toolbar button item before a specified toolbar button item, from the list of buttons available.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD InsertItem(
	nButtonID,
	nMenuItemID,
	nBeforeID,
	bState,
	bStyle,
	symTB
) AS USUAL CLIPPER
Request Example View Source

Parameters

nButtonID (Optional)
Type: Usual
The ID of the new toolbar button item. To add a gap between groups of buttons, append an item labeled IDT_SEPARATOR. To see the button items available, see Appendix A or bring up a list in the Menu Editor.
nMenuItemID (Optional)
Type: Usual
The ID of the menu item corresponding to the new toolbar button item.
nBeforeID (Optional)
Type: Usual
The ID of the toolbar button item before which the new toolbar button item should be inserted. If omitted, the new toolbar button item is inserted after the last toolbar button item.
bState (Optional)
Type: Usual
** missing parameter documentation **
bStyle (Optional)
Type: Usual
** missing parameter documentation **
symTB (Optional)
Type: Usual
Symbolic name representing the toolbar to be used. Defaults to the main toolbar.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
Both the event triggered when the button is clicked and the description that shows up in the status bar are based on the properties of the associated menu. Thus, the toolbar controls the action of the application indirectly, through its associated menu. Specifying a toolbar by calling this method for each button might seem cumbersome. The recommended way to define the toolbar is to use the Menu Editor, which automatically generates code to lay out the toolbar. Note that the user can modify the set of button items on the toolbar with the configuration dialog. The program does not need to concern itself with what buttons exist, since the events come in as if they were menu selections. In order to reduce "visual noise" (undesirable blinking and flicker), the toolbar does not immediately reflect a button added with InsertItem(). Instead, you must call Update() to make all the new buttons show up at once. The Show() method automatically updates the display. For toolbars that are defined once and for all and attached to a window, there is no need for explicitly calling Update(), it is intended only for toolbars that change their button configuration on the fly.
See Also