Skip to content

CreateCommandBarControl - cCJMenuItem

Creates the COM control and adds to the passed collection of controls

Type: Function
Return Data Type: Variant

Parameters

Parameter Type Description
hoControls Handle Proxy cCJCommandBarControls object, which is a collection of all controls for the parent object
eType Integer The peControlType of the object to be created.
iId Integer Unique numeric action ID
bInCreateTempInstance Boolean Determines if the control is temporary

Syntax

Function CreateCommandBarControl Handle hoControls Integer eType Integer iId Boolean bInCreateTempInstance Returns Variant

Call Example

Get CreateCommandBarControl hoControls eType iId bInCreateTempInstance to VariantVariable

Description

CreateCommandBarControl is called by CreateComControl to create the COM cCJCommandBarControl control.

It is added to the cCJCommandBarControls collection object passed as hoControl.

eType must be one of the following: | Constant | Meaning | |---|---| | xtpControlButton | Specifies the button control style. This is a normal commandbar button that is used in the menubar and toolbars. | | xtpControlPopup | Specifies the popup control style. This is used for popup menus in menus and toolbars. When clicked, a popup menu will display any added controls. | | xtpControlButtonPopup | Specifies the button popup control style. This will add a control that displays an image with no caption. When clicked, a popup menu will display any added controls. | | xtpControlSplitButtonPopup | Specifies the split button popup control style. | | xtpControlComboBox | Specifies the combobox control style. This will add a combobox control to your command bar. | | xtpControlEdit | Specifies the edit control style. This will add an edit box control to your command bar. | | xtpControlCustom | Specifies the custom control style. This allows you to add any control you want to your command bar. For example, you can add a progress bar or slider control to your command bar. | | xtpControlLabel | Specifies the Label control style. This will add a control that is used for informational purposes only. This command will not respond to the mouse and cannot receive focus. The background will be displayed in a different color. You can use this to display helpful information about your popup menu. | | xtpControlCheckBox | Specifies the checkbox control style. When using this style the control's checked property is used to determine whether the checkbox is checked or un-checked. | | xtpControlGallery | Specifies the Gallery control style. Galleries can be placed in normal toolbars, popup menus, and ribbon groups. | | xtpControlRadioButton | Specifies the Radio/Option button control style. This will add an Radio/Option button control to your commandbar. |

iId is the action ID - a unique numeric ID that is normally the auto-assigned piID value.

The bInCreateTempInstance parameter determines if the control is temporary. If true, this indicates that the control is being created temporarily and that it should not be saved as part of the commandbar system's layout. When a control is created using AddDynamicControl this parameter will be true.

This returns a variant pointer to the newly created COM control. This control is not bound to a proxy object.

This message will probably never be sent or augmented. If you are using this, you are working at a very low level. In such a case you should carefully review the class source code and carefully review the Codejock interface documentation.

Return Value

Returns a variant pointer to the newly created COM control