GuiComboBoxIsOpen

From Multi Theft Auto: Wiki
Revision as of 17:05, 23 September 2018 by FileEX (talk | contribs) (Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0157|1.5.6|14489|This function returns the state of combobox.}} ==Syntax== <syntaxhighlight lang="lua"> bool guiComboBoxIs...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function returns the state of combobox.

Syntax

bool guiComboBoxIsOpen( element comboBox )

Required Arguments

  • comboBox: The combo box to get the state.

Returns

Returns true if combobox is opened, false if combobox is closed, nil otherwise.

Example

This example show info about combobox after click on screen.

local comboBox = guiCreateComboBox(0.30,0.45,0.30,0.20,'Test',true) -- create the gui combo-box

for i = 1,20 do
	guiComboBoxAddItem(comboBox, tostring(i)) -- add items
end

addEventHandler('onClientClick',root,function(b,s)
	if b == 'left' and state == 'down' then
		if guiGetVisible(comboBox) then
			local state = guiComboBoxIsOpen(comboBox) -- get state of the combobox
			outputChatBox('Combobox is '..(state and 'open' or 'close')) -- show info about combobox
		end
	end
end)

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

Input

GUI