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


#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



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.
  #PB_CheckBox_Inbetween: Set the "in between" state. (Only for #PB_CheckBox_ThreeState checkboxes)
- 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.
- IPAddressGadget(): change the current IP address.
- 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.
- MDIGadget(): Change the currently focused childwindow (by giving the related #Window number), or use one of the following values:
  #PB_MDI_Cascade         : Cascade the child windows
  #PB_MDI_TileVertically  : Tile the childwindows vertically
  #PB_MDI_TileHorizontally: Tile the childwindows horizontally
  #PB_MDI_Next            : Give focus to the next childwindow
  #PB_MDI_Previous        : Give focus to the previous childwindow
  #PB_MDI_Arrange         : Arrange the iconic (minimized) windows
- OptionGadget(): 1 to activate it, 0 otherwise.
- PanelGadget(): change the current panel.
- ProgressBarGadget(): change progress bar value. A value of #PB_ProgressBar_Unknown can be used to indicate that the progress is unknown.
- ScrollBarGadget(): change the current slider position.
- ShortcutGadget(): Change the current shortcut.
- 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()

Supported OS


<- SetGadgetItemText() - Gadget Index - SetGadgetText() ->