guiComboBoxIsOpen | Multi Theft Auto: Wiki Skip to content

guiComboBoxIsOpen

Client-side
Server-side
Shared

Pair: guiComboBoxSetOpen

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function returns the state of combobox.

Syntax

guiComboBoxIsOpen ( )

Code Examples

client

This example opens/closes the combobox after clicking the button. Checking if combobox is opened and change button text.

local comboBox = guiCreateComboBox(0.30,0.45,0.30,0.20,'Test',true) -- create the gui combo-box
local openButton = guiCreateButton(0.35,0.31,0.15,0.15,'Show numbers',true) -- create the button
for i = 1,20 do
guiComboBoxAddItem(comboBox, tostring(i)) -- add items
end
addEventHandler('onClientGUIClick',openButton,function()
if not guiComboBoxIsOpen(comboBox) then
guiComboBoxSetOpen(comboBox, true) -- open the combobox
guiSetText(source, 'Hide numbers')
else
guiComboBoxSetOpen(comboBox, false) -- close the combobox
guiSetText(source, 'Show numbers')
end
end)

See Also

GUI Functions