How do I know the current width of system scrollbar?

If you want to know the size of a ScrollableControl minus the size of the scroll bar, the easiest way is to use the Control.ClientSize property.

From the documentation:

Gets or sets the height and width of the client area of the control. The client area of a control is the bounds of the control, minus the nonclient elements such as scroll bars, borders, title bars, and menus.


Vertical Scroll Bar Width

System.Windows.Forms.SystemInformation.VerticalScrollBarWidth;

Look at the System.Windows.Forms.SystemInformation class members: HorizontalScrollBarHeight and VerticalScrollBarWidth.

Tags:

C#

Winforms