Checkbox

From Real Software Documentation

Jump to: navigation, search
For web applications, see WebCheckBox.
Class (inherits from RectControl)

The standard checkbox control used by desktop applications.

Events
Action KeyUp
Close LostFocus
ConstructContextualMenu MouseDown
ContextualMenuAction MouseEnter
DragEnter MouseExit
DragExit MouseMove
DragOver MouseUp
DropObject MouseWheel
GotFocus Open
KeyDown


Properties
Active Left State
AutoDeactivate LockBottom TabIndex
Bold LockLeft TabStop
Caption LockRight TextFont
DataField LockTop TextSize
DataSource MouseCursor Top
Enabled MouseX TrueWindow
Handle MouseY Underline
Height Name Value
HelpTag PanelIndex Visible
Index Parent Width
Italic Scope Window


Methods
AcceptFileDrop Invalidate
AcceptPictureDrop Refresh
AcceptRawDataDrop RefreshRect
AcceptTextDrop SetBoolean
Close SetFocus
DrawInto

Notes

Checkboxes can have three states: File:CheckBox_States.png

Examples

The following code in the CheckBox’s Action event handler checks the value of the CheckBox.

If CheckBox1.value then
TextField1.text="True"
else
TextField1.text="False"
end if

Because Checkbox is a three-state control, you can use the State property to get and set its value. The CheckedStates Enumeration is designed to get and set the values.

The following code sets the State property of a Checkbox to Indeterminate.

Checkbox1.State = Checkbox.CheckedStates.Indeterminate


Because State is an enumeration, you cannot use the corresponding integer value for comparison. The following code shows how to use State in a Select Case statement.

select case CheckBox1.State
case CheckBox.CheckedStates.Unchecked
// The CheckBox is unchecked

case CheckBox.CheckedStates.Checked
// The CheckBox is checked

case CheckBox.CheckedStates.Indeterminate
// The CheckBox state is indeterminate

end select


See the entries for State and Value for additional examples of setting and getting Checkbox values. See also the CheckedStates Enumeration.

See Also

RadioButton control; RectControl class.

Personal tools