GuiCheckBoxGetSelected

From Multi Theft Auto: Wiki
Revision as of 16:30, 10 November 2011 by Arran Fortuna (talk | contribs) (Undo revision 27629 by Alsa7er2011 (talk) Your example makes absolutely no sense, please learn to script before submitting an 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

This page lacks an 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