SetGadgetState()

Syntax

SetGadgetState(#Gadget, State)
Description
Change the current state of the specified gadget.

Parameters

#Gadget The gadget to use.
State The new state for the gadget. See below for the meaning of this value depending on the gadget type.

Return value

None.

Remarks

This is a universal function which works for almost all gadgets:

- ButtonImageGadget(): change the current state of a #PB_Button_Toggle gadget (1 = toggled, 0 = normal).
- ButtonGadget(): change the current state of a #PB_Button_Toggle gadget (1 = toggled, 0 = normal).
- CalendarGadget(): set the currently selected date.
- CheckBoxGadget(): Change the state of the checkbox. The following values are possible:
  #PB_CheckBox_Checked  : Set the check mark.
  #PB_CheckBox_Unchecked: Remove the check mark.
- ComboBoxGadget(): change the currently selected item.
- DateGadget(): set the currently displayed date/time. If #PB_Date_CheckBox was used, set 'State' to 0 to uncheck the checkbox.
- ImageGadget(): change the current image of the gadget.
- ListIconGadget(): change the currently selected item. If -1 is specified, all items will be deselected.
- ListViewGadget(): change the currently selected item. . If -1 is specified, it will remove the selection.
- OptionGadget(): 1 to activate it, 0 otherwise.
- PanelGadget(): change the current panel.
- ProgressBarGadget(): change progress bar value.
- SpinGadget(): change the current value.
- SplitterGadget(): change the current splitter position, in pixels.
- TrackBarGadget(): change the current cursor position.
- TreeGadget(): change the currently selected item, -1 selects no item.
- WebGadget(): perform some action on the gadget. See WebGadget for further descriptions.

See Also

GetGadgetState(), GetGadgetItemState(), SetGadgetItemState()
<- SetGadgetItemText() - Gadget Index - SetGadgetText() ->