Skip to content

ClassForControlType - cCJAction

Returns the best class for the passed control type

Type: Function
Return Data Type: Integer

Parameters

Parameter Type Description
eType Integer The peControlType of the object to be created.

Syntax

Function ClassForControlType Integer eType Returns Integer

Call Example

Get ClassForControlType eType to IntegerVariable

Description

ClassForControlType can be used to find the best class for a control type. It returns the class ID that is the best class for this type.

The possible controls types and the class ID returned for each type are:

Control Type Return Class ID Description
xtpControlButton cCJCommandBarButtonSpecifies the button control style. This is a normal command bar button that is used in the menubar and toolbars.
xtpControlPopup cCJCommandBarPopupSpecifies 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 cCJCommandBarPopupSpecifies 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 cCJCommandBarPopupSpecifies the split button popup control style.
xtpControlComboBox cCJCommandBarComboBoxSpecifies the combobox control style. This will add a combobox control to your command bar.
xtpControlEdit cCJCommandBarEditSpecifies the edit control style. This will add an edit box control to your command bar.
xtpControlCustom cCJCommandBarControlCustomSpecifies 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 cCJCommandBarButtonSpecifies 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 cCJCommandBarButtonSpecifies 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 cCJCommandBarGallerySpecifies the Gallery control style. Galleries can be placed in normal toolbars, popup menus, and ribbon groups.
xtpControlRadioButton cCJCommandBarButtonSpecifies the Radio/Option button control style. This will add a Radio/Option button control to your command bar.

Samples

This creates a proxy object for a combo object and binds it to a COM control, which is, presumably, a combo control.

Handle hoObj
Integer iClass
Get ClassForControlType xtpControlComboBox to iClass
Get Create iClass to hoObj
Set pvComObject of hoObj to vControl

This creates a proxy object for a COM control of any type.

You will never need to create this function because it already exists as CreateProxyControl

Function CreateProxyControl Variant vControl Returns Handle
    Handle hoObj
    Integer eType iClass
    Get Create U_cCJCommandBarControl to hoObj
    Set pvComObject of hoObj to vControl
    Get ComType of hoObj to eType
    Send Destroy of hoObj
    Move 0 to hoObj
    Get ClassForControlType eType iClass
    If (iClass<>0) Begin
        Get Create iClass to hoObj
        Set pvComObject of hoObj to vControl
    End
    Function_Return hoObj
End_Function

See Also

CreateProxyControl

Return Value

Returns the class ID for the control type