Garry's Mod Wiki

Garry's Mod Wiki

  DProperty_Combo:SetSelected( number Id )

Description

Set the selected option.

Arguments

1 number Id
Id of the choice to be selected.

Example

Set the second option selected.

local choice = DP:CreateRow( "Choices", "Hello world" ) choice:Setup( "Combo" ) choice:AddChoice( "Choice #1", {} ) choice:AddChoice( "Choice #2", 8 ) choice:AddChoice( "Choice #3", "Hello world", true ) choice:SetSelected( 2 ) -- Even if "Choice #3" is selected by default, "Choice #2" will be selected.

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...