CheckBoxGadget()
Syntax
Result = CheckBoxGadget(#Gadget, x, y, Width, Height, Text$ [, Flags])Description
Create a checkbox gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by EventGadget() command. The 'Text$' is a description of the checkbox which will be displayed to the right of it.
You can add a 'mini help' to this gadget by using GadgetToolTip().
- GetGadgetState() can be used to get the current gadget state (checked or unchecked).
- SetGadgetState() can be used to change the gadget state (checked or unchecked).
'Flags' are always optional and can be one of the following constants:#PB_CheckBox_Right : Aligns the text to right #PB_CheckBox_Center : Centers the textExample:If OpenWindow(0, 0, 0, 270, 130, "CheckBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) CheckBoxGadget(0, 10, 10, 250, 20, "CheckBox standard") CheckBoxGadget(1, 10, 40, 250, 20, "CheckBox checked") : SetGadgetState(1,1) CheckBoxGadget(2, 10, 70, 250, 20, "CheckBox right", #PB_CheckBox_Right) CheckBoxGadget(3, 10, 100, 250, 20, "CheckBox center", #PB_CheckBox_Center) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Supported OS
All