GuiCheckBoxGetSelected

From Multi Theft Auto: Wiki
Revision as of 16:07, 10 November 2011 by Alsa7er2011 (talk | contribs) (→‎Example)
Jump to navigation Jump to search

This function gets a checkbox's selection state.

Syntax

bool guiCheckBoxGetSelected ( element theCheckbox )

Required Arguments

  • theCheckbox : The checkbox you wish to retrieve the selection state of.

Returns

Returns true if the checkbox is selected, false if it is not.

Example

function onClick (button, state, absoluteX, absoluteY) -- on Gui Click Func.
if ( source == myButton) then

	isSelected = guiCheckBoxGetSelected(CheckBox) -- check if the check box is selected
	
	if isSelected == true then -- if selected then
	outputChatBox("The CheckBox  is Selected")
	else -- else if its not selected
	outputChatBox("The CheckBox  is not Selected")
	end

end
end
addEventHandler ("onClientGUIClick", getRootElement(), onClick)  -- adding event handler for on click

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows