Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know the current width of system scrollbar?

Tags:

c#

winforms

As you know, one can customize the width of the scrollbar width in Display Properties -> Appearance -> Advanced -> Item: ScrollBar. The default value is 17. However, I can't assume this is always the case, is it possible for me to retrieve this value?

like image 319
Hao Wooi Lim Avatar asked May 13 '09 09:05

Hao Wooi Lim


People also ask

How do I know my scroll bar height?

To get the height of the scroll bar the offsetHeight of div is subtracted from the clientHeight of div. OffsetHeight = Height of an element + Scrollbar Height. ClientHeight = Height of an element. Height of scrollbar = offsetHeight – clientHeight.

How do I change the width of my scroll bar?

Change Scrollbar Width in Windows 11/10 Select the key and in the right pane of WindowsMetrics, double-click 'ScrollHeight' word. Instantly, a window should appear on your computer screen (EDIT DWORD). In the value data field of the window, enter a data value. The default value for scroll width is -225.


1 Answers

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

like image 96
leppie Avatar answered Sep 20 '22 06:09

leppie