DForm/ComboBox

From Garry's Mod
Jump to: navigation, search
 DForm:ComboBox( )

Contents

DescriptionPanelFunc

Adds a DComboBox onto the DForm

Arguments

string title

Text to the left of the combo box

Arguments

string convar

Console variable to change when the user selects something from the dropdown.

Returns

Panel

The created DComboBox

Returns

Panel

The created DLabel

Examples

Example

local frame = vgui.Create( "DFrame" )
frame:SetSize( ScrW() / 2, ScrH() / 2 )
frame:MakePopup()

local form = frame:Add("DForm")
form:Dock( FILL )
form:DockMargin( 5, 5, 5, 5 )

local combobox, label = form:ComboBox( "test", "sv_accelerate" )
combobox:AddChoice( "10" ) -- 10 will be used as convar value
combobox:AddChoice( "1000", 100 ) -- 100 will be used as convar value


Personal tools
Navigation