Garry's Mod Wiki

DCheckBoxLabel:OnChange

DCheckBoxLabel:OnChange( boolean bVal )

Description

Called when the "checked" state is changed.

Arguments

1 boolean bVal
Whether the checkbox is checked or unchecked.

Example

Creates a a DCheckBoxLabel that prints to the console when ticked/unticked

local Frame = vgui.Create( "DFrame" ) Frame:SetSize( 300, 100 ) Frame:SetPos( 200, 200 ) local LabelBox = vgui.Create( "DCheckBoxLabel", Frame ) LabelBox:SetPos( 10, 40 ) LabelBox:SetText( "This is a DLabel" ) function LabelBox:OnChange( val ) if val then print( "The box has been ticked!" ) else print( "The box has been unticked!" ) end end
Output: The box has been ticked!

Page Links


Special Pages


Wikis

?

Render Time: 38ms

DB GetPage 3
Generate Html 4
SaveChanges (1) 9
Render Body 0
Render Sidebar 19