Garry's Mod Wiki

Garry's Mod Wiki

  string DComboBox:GetOptionText( number index )

Description

Returns an option's text based on the given index.

Arguments

1 number index
The option index.

Returns

1 string
The option's text value.

Example

Create a combo box listing some colors and print the 3rd option's text.

local cbox = vgui.Create("DComboBox") cbox:SetPos(5, 5) cbox:SetSize(200, 20) cbox:SetValue("Colors") cbox:AddChoice("Red") cbox:AddChoice("Green") cbox:AddChoice("Blue") cbox:AddChoice("Yellow") print(cbox:GetOptionText(3))
Output: Blue

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...