CheckBoxGadget()
Syntax
Result = CheckBoxGadget(#Gadget, x, y, Width, Height, Text$ [, Flags])Description
Create a checkbox gadget in the current GadgetList.
Parameters
#Gadget A number to identify the new gadget. #PB_Any can be used to auto-generate this number. x, y, Width, Height The position and dimensions of the new gadget. Text$ The text (HTML format) to display next to the checkbox. Flags (optional) Flags to modify the gadget behavior. It can be a combination of the following constants: #PB_CheckBox_Right : Aligns the text to right. #PB_CheckBox_Center : Centers the text.
Return value
Returns nonzero on success and zero on failure. If #PB_Any was used as the #Gadget parameter then the return-value is the auto-generated gadget number on success.
Remarks
A 'mini help' can be added to this gadget using GadgetToolTip().
- GetGadgetState() can be used to get the current gadget state.
- SetGadgetState() can be used to change the gadget state.
Example
If OpenWindow(0, 0, 0, 270, 130, "CheckBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) CheckBoxGadget(0, 10, 10, 250, 20, "CheckBox standard") CheckBoxGadget(1, 10, 40, 250, 20, "CheckBox checked") : SetGadgetState(1, #PB_Checkbox_Checked) CheckBoxGadget(2, 10, 70, 250, 20, "<i>CheckBox right</i>", #PB_CheckBox_Right) ; Using HTML format CheckBoxGadget(3, 10, 100, 250, 20, "CheckBox center", #PB_CheckBox_Center) EndIf
See Also
GetGadgetState(), SetGadgetState(), OptionGadget()
Supported OS
All