Garry's Mod Wiki

DComboBox:GetOptionText

DComboBox:GetOptionText

  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

Special Pages


Wikis

?

Render Time: 54ms

DB GetPage 37
Generate Html 3
SaveChanges (1) 5
Render Body 0
Render Sidebar 6