DPanelList.EnableVerticalScrollbar

From GMod Wiki

Jump to: navigation, search
Function
Syntax DPanelList.EnableVerticalScrollbar( )
Description:
Adds a scrollbar.
Returns: Boolean
In Object: DPanelList
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DPanelList.EnableVerticalScrollbar]DPanelList.EnableVerticalScrollbar [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionIf the panel has more items in the list than it's height, it will add a scrollbar.
Used onNewerClient.png
Code
YourPanel = vgui.Create("DCollapsibleCategory", DermaPanel)  -- A collapsible category
YourPanel:SetPos( 25,50 ) --Setting its position on the Derma panel
YourPanel:SetSize( 200, 50 ) -- Setting the size of the sheet
YourPanel:SetExpanded( 1 ) -- Should the drop down be dropped?
YourPanel:SetLabel( "Test Title" ) -- Set the title of drop down
 
CategoryList2 = vgui.Create( "DPanelList" )
CategoryList2:SetAutoSize( true ) -- Size it to automatically
CategoryList2:SetSpacing( 5 ) -- Space in between other items on the drop down
CategoryList2:EnableHorizontal( false ) -- Should there be a horizontal scroll bar?
CategoryList2:EnableVerticalScrollbar( true ) -- Should there be a vertical scroll bar?
 
YourPanel:SetContents( CategoryList2 ) -- Add the items to the correct drop down
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox