Skip to content

ButtonState

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
BlitzPlus

ButtonState

ButtonState:Int32 button:Int32
Parameter Mode Type Default Description
button In Int32 required Handle of a button made with style 2 or 3.

Returns: 1 if it is ticked, 0 if not.

Description

Says whether a check box or radio button is ticked. The state of normal buttons is always 0.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Check", 10, 10, 300, 120, Desktop(), 3)
box = CreateButton("Sound on", 10, 10, 200, 24, win, 2)
SetButtonState box, True
Repeat
	e = WaitEvent()
	If e = $401 And EventSource() = box Then SetGadgetText win, "State " + ButtonState(box)
Until e = $803

Related Commands

ActivateGadget, AddGadgetItem, CreateButton, SetButtonState

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally