Skip to main content

ButtonType Property

Determines whether the OLE Button will behave as a standard push button or as a checkbox (aka toggle button). By default the control will act as a standard push button. When used as a checkbox you can specify whether it will have two or three states.

Definition​

Property "OLE.ButtonType" as Option

Values​

Option can be set to one of the following valid options:

ValueDescription
"Normal" or "N"A standard push button. (Default)
"Toggle" or "TG"A two state toggle button: checked and unchecked.
"TriState" or "TS"A three state toggle button: checked, unchecked, and undetermined

Remarks​

OpenInsight allows two and three state checkbox controls but only two state graphical checkbox controls (i.e. checkbmps). Using the ButtonType property, the SRP Button Control can behave like a two or three state graphical checkbox.

When used as a graphical checkbox, 'checked' buttons will appear as if the button was clicked. Buttons that have an 'undetermined' state will have the same appearance as if being 'checked' but the caption will be grayed out:

TriState

Use the State property to determine what state (i.e. checked, unchecked, or undetermined) the graphical checkbox is in.

Graphics can be added to the OLE button by using the Icon property. Normally this property is used to provide an image that appears within the borders of the button control while still using the button's current style. However, if you wish to customize the entire appearance of the button then use the OwnerDrawn value of the Style property. This works similar to how OpenInsight supports images on pushbuttons by allowing you use a multi-framed image to control how each state (i.e. at rest, clicked, disabled, etc.) will appear.

Example​

// Set the button to be a toggle button
Set_Property(@Window:".OLE_BUTTON", "OLE.ButtonType", "Toggle")

// Set the button to be a tri-state button using the abbreviated option
Set_Property(@Window:".OLE_BUTTON", "OLE.ButtonType", "TS")

See Also​

State, Icon, Style