Garry's Mod Wiki



This is used internally - although you're able to use it you probably shouldn't. Use DScrollPanel.

A scrollbar used in DScrollPanel.

The scrollbar notably contains DVScrollBar.btnUp, DVScrollBar.btnDown, and DVScrollBar.btnGrip which are the up button, down button, and grip respectively. Editing the paint functions of these allows custom scrollbar styling. See DScrollPanel:GetVBar for an example.


Derives methods, etc not listed on this page from Panel.


boolean DVScrollBar:AddScroll( number add )
Adds specified amount of scroll in pixels.
DVScrollBar:AnimateTo( number scroll, number length, number delay = 0, number ease = -1 )
Smoothly scrolls to given level.
number DVScrollBar:BarScale()
No Description
boolean DVScrollBar:GetHideButtons()
Returns whether or not the manual up/down scroll buttons are visible or not. Set by DVScrollBar:SetHideButtons.
number DVScrollBar:GetOffset()
Returns the negative of DVScrollBar:GetScroll.
number DVScrollBar:GetScroll()
Returns the amount of scroll level from the top in pixels
This is used internally - although you're able to use it you probably shouldn't. Called from within DScrollBarGrip
DVScrollBar:SetHideButtons( boolean hide )
Allows hiding the up and down buttons for better visual stylisation.
DVScrollBar:SetScroll( number scroll )
Sets the scroll level in pixels.
DVScrollBar:SetUp( number barSize, number canvasSize )
Sets up the scrollbar for use. The scrollbar will automatically disable itself if the total height of the canvas is lower than the height of the panel that holds the canvas during this function call.
any DVScrollBar:Value()
We advise against using this. It may be changed or removed in a future update. Should return nil in all cases. See DVScrollBar:GetScroll.