OnStateChanged||doc136710

September 20, 2022

Format

local event = RadioButton:GetEvent("OnStateChanged")

Describe

The event is triggered when the selected state in the radio button control changes.

Callback function parameters

Type name introduce
RadioButton radioBtn Current radio button

Code example

--Create a RadioButton control
local radioBtn = UI:CreateGUIWidget(Enum.WidgetType.RadioButton)
radioBtn.Parent = UI.Root

local event = radioBtn:GetEvent("OnStateChanged")
event:Bind(function(radioBtn)
    print("radioBtn state changed! ", radioBtn.Selected)
end)