Description
DScrollPanel is a VGUI Element similar to DPanel however it has a vertical scrollbar docked to the right which can be used to put more content in a smaller area. DScrollPanels are essentially DPanels with the Scroll Bar.
This can be used to replace the DPanelList with DPanelList:EnableVerticalScrollbar and get similar functionality as well as using a non-deprecated element.
If you would like to paint or edit the elements of the scrollbar use DScrollPanel:GetVBar. If you want to see if the scrollbar is visible then use the VBar.Enabled variable on the scrollbar's VBar.
View source
Parent
Derives methods, etc not listed on this page from DPanel.
Implements
Implements or overrides the following hooks/methods. If you want to override these, you probably want to call the original function too.
Methods
Parents the passed panel to the DScrollPanel's canvas.
Returns the canvas ( The panel all child panels are parented to ) of the DScrollPanel.
We advise against using this. It may be changed or removed in a future update.
Gets the DScrollPanels padding, set by DScrollPanel:SetPadding.
Returns the vertical scroll bar of the panel.
Return the width of the DScrollPanel's canvas.
This is used internally - although you're able to use it you probably shouldn't.
Used internally to rebuild the panel's children positioning. You should use Panel:InvalidateLayout instead.
This is used internally - although you're able to use it you probably shouldn't.
Used internally to rebuild the panel's children positioning. You should use Panel:InvalidateLayout instead.
Scrolls to the given child
This is used internally - although you're able to use it you probably shouldn't.
Sets the canvas of the DScrollPanel.
We advise against using this. It may be changed or removed in a future update.
Sets the DScrollPanel's padding. This function appears to be unused.
Example
Output: