AddCommandBar()

Examples


The AddCommandBar() function defined in the syCmdBarObj form is used to add a toolbar to Microsoft Dynamics GP.

Syntax

AddCommandBar(UserID, ParentDictID, ParentFormID, ParentCmdID, visible, row_number, position, clone)

Parameters

UserID – A string that specifies which user’s set of toolbars the new toolbar will be added to. Specify the empty string ("") to add the new toolbar to the default set of toolbars.

ParentDictID – The ID of the dictionary that contains the command list that will be used to contain the toolbar items.

ParentFormID – The resource ID of the command form that contains the definition of the command list that will be used to contain the toolbar items.

ParentCmdID – The resource ID of the command list that will contain the toolbar items.

visible – A boolean that indicates whether the toolbar will be displayed by default. The value true indicates the toolbar will be displayed, while false indicates it will not.

row_number – An integer that specifies which row the toolbar will attempt to be placed on. If the row doesn’t exist, a new row will be added.

position – An integer variable that specifies the horizontal position of the toolbar on the row. The value is measured in pixels from the left edge of the main Microsoft Dynamics GP window. The value 0 specifies the toolbar will be added as the first item in the row.

clone – A boolean parameter. The value true specifies that the toolbar will be added for all users, while the value false specifies that the toolbar will be added for only the specified user.

Return value

An integer indicating whether the toolbar was added. The value corresponds to one of the following constants:

[spacer]

Constant

Description

OKAY

The toolbar was successfully added.

DUPLICATE

The toolbar was not added because it already exists.



Documentation Feedback