CheckBox control

CheckBox controls are small square boxes used to set independent options. When they are selected, they display a mark (typically, either an X or a check mark). When they are not selected, they are empty.

Since check boxes are independent of each other, you can group them without affecting their behavior. Grouping check boxes makes the window easier for the user to understand and use.

Typically, check boxes have two states: on and off. You can also use a third state, unknown or unspecified. In the third state, the check is grayed.

Properties

CheckBox property

Datatype

Description

AccessibleDescription

String

A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users.

AccessibleName

String

A label that briefly describes the control, such as the text in a button or the name of a menu item.

AccessibleRole

AccessibleRole (enumerated)

Describes what kind of user interface element the control is.

Automatic

Boolean

Specifies whether the control displays a mark when the user clicks it. Values are:

  • TRUE – Displays mark when clicked.

  • FALSE – Does not display mark when clicked.

BackColor

Long

Specifies the numeric value of the background color: –2 to 16,777,215. For more information about color, see the RGB function in the PowerScript Reference.

BorderStyle

BorderStyle (enumerated)

Specifies the style of the border of the control. Values are:

  • StyleLowered!

  • StyleRaised!

BringToTop

Boolean

Specifies whether PowerBuilder moves the control to the top of the front-to-back order. Values are:

  • TRUE – Move to the top.

  • FALSE – Do not move to the top.

Checked

Boolean

Specifies whether the control is selected. Values are:

  • TRUE – Control is selected.

  • FALSE – Control is not selected.

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

DragAuto

Boolean

Specifies whether PowerBuilder puts the control automatically into Drag Mode. Values are:

  • TRUE – When the control is clicked, the control is automatically in Drag Mode.

  • FALSE – When the control is clicked, the control is not automatically in Drag Mode. You have to put the control into Drag Mode manually by using the Drag function.

DragIcon

String

Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control.

When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays.

Enabled

Boolean

Specifies whether the control is enabled (can be clicked). Values are:

  • TRUE – Control can be clicked.

  • FALSE – Control cannot be clicked.

FaceName

String

Specifies the name of the typeface in which the text of the control displays; for example, arial or courier.

FontCharSet

FontCharSet (enumerated)

Specifies the font character set used for the text in the control. The application must be running on an appropriate version of PowerBuilder under an operating system that supports the selected character set. For a complete list of possible values, see the list of properties for the FontCharSet variable on the Enumerated tab page of the Browser.

FontFamily

FontFamily (enumerated)

Specifies the font family (type style) used for the text in the control. Values are:

  • AnyFont!

  • Decorative!

  • Modern!

  • Roman!

  • Script!

  • Swiss!

FontPitch

FontPitch (enumerated)

Specifies the pitch (spacing) of the font used for the text in the control. Values are:

  • Default!

  • Fixed!

  • Variable!

Height

Integer

Specifies the height of the control, in PowerBuilder units.

Italic

Boolean

Specifies whether the text in the control is italic. Values are:

  • TRUE – Text is italic.

  • FALSE – Text is not italic.

LeftText

Boolean

Specifies whether the text displays on the left of the control. Values are:

  • TRUE – Text displays on left.

  • FALSE – Text displays on right.

Typically, you set this property to false so the text appears on the right of the control.

Pointer

String

Specifies the name of the stock pointer or the file containing the pointer used for the control.

RightToLeft

Boolean

Specifies that characters should be displayed in right-to-left order. The application must be running on an operating system that supports right-to-left display. Values are:

  • TRUE – Characters display in right-to-left order.

  • FALSE – Characters display in left-to-right order.

TabOrder

Integer

Specifies the tab value of the control within the window (0 means the user cannot tab to the control).

Tag

String

Specifies the tag value assigned to the control.

Text

String

Specifies the text that displays next to the control.

TextColor

Long

Specifies the numeric value of the color used for text: -2 to 16,777,215. For more information about color, see the RGB function in the PowerScript Reference.

TextSize

Integer

Specifies the size of the text in the control, in points. For backward compatibility, the size is stored as a negative number; for example, 10-point text size is stored as -10.

ThirdState

Boolean

Specifies whether the control is in the third state when the control has been defined to have three states. Values are:

  • TRUE – Control is in third state.

  • FALSE – Control is not in third state.

ThreeState

Boolean

Specifies whether the control has three states. Typically, CheckBox controls have only two states, such as on and off. Values are:

  • TRUE – Control has three states.

  • FALSE – Control does not have three states.

Underline

Boolean

Specifies whether the text in the control is underlined. Values are:

  • TRUE – Text is underlined.

  • FALSE – Text is not underlined.

Visible

Boolean

Specifies whether the control is visible. Values are:

  • TRUE – Control is visible.

  • FALSE – Control is not visible.

Weight

Integer

Specifies the stroke weight of the text in the control; for example, 400 for normal or 700 for bold.

Width

Integer

Specifies the width of the control, in PowerBuilder units.

X

Integer

Specifies the X position (the distance from the left edge of the window), in PowerBuilder units.

Y

Integer

Specifies the Y position (the distance from the top of the window), in PowerBuilder units.

Events

CheckBox event

Occurs

Clicked

When the control is clicked (selected or unselected)

Constructor

Immediately before the Open event occurs in the window

Destructor

Immediately after the Close event occurs in the window

DragDrop

When a dragged control is dropped on the control

DragEnter

When a dragged control enters the control

DragLeave

When a dragged control leaves the control

DragWithin

When a dragged control is within the control

GetFocus

Just before the control receives focus (before it is selected and becomes active)

Help

When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control

LoseFocus

When the control loses focus (becomes inactive)

Other

When a Windows message occurs that is not a PowerBuilder event

RButtonDown

When the right mouse button is pressed on the control

Functions

CheckBox function

Datatype returned

Description

ClassName

String

Returns the name assigned to the control

Drag

Integer

Starts or ends the dragging of the control

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service

GetParent

PowerObject

Returns a reference to the name of the parent object

Hide

Integer

Makes the control invisible

Move

Integer

Moves the control to a specified location

PointerX

Integer

Returns the distance of the pointer from the left edge of the control

PointerY

Integer

Returns the distance of the pointer from the top of the control

PostEvent

Boolean

Adds an event to the end of the message queue for the control

Print

Integer

Prints the control

Resize

Integer

Changes the size of the control

SetFocus

Integer

Sets focus to the control

SetPosition

Integer

Specifies the position of the control in the front-to-back order of the window

SetRedraw

Integer

Controls automatic redrawing of the control after each change in its Properties

Show

Integer

Makes the control visible

TriggerEvent

Integer

Triggers a specified event in the control and executes the script for the event

TypeOf

Object

Returns the type of the control