Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change width of scrollbars

I am working on a program for touchscreens. I am using c# and Visual studio 2008. Is there any way to change the width of the scrollbars? I know that i can change in Display Properties of Windows. But i only want in my programm not in the complete system. Thanks for ya help!

like image 629
Hanfrey Avatar asked Jan 04 '11 13:01

Hanfrey


People also ask

How do I adjust the scrollbar width?

How to Customize the Scrollbars Width to be Narrower or Wider. If you want to change the scroll width too (or only the scroll width), you'll find it just under ScrollHeight in the right pane. So double-click/tap on the ScrollWidth to open the Edit String window.

How do I change the scrollbar width in Chrome?

Once you have installed this extension on your Chrome browser, click on its extension icon present on the top right part of the Chrome browser. This will open the Options or Settings page of this Chrome extension. On the Options page, you will see a slider for Scrollbar Size.

How do I change the scrollbar width in Windows 11?

Change Height and Width of the Scrollbars Double-click on the ScrollHeight key to change scrollbar height, or ScrollWidth to change its width. Change the number in the Value data column to adjust the height or width. It's set to -255 by default.

How wide are scrollbars?

The default scrollbar width can range anywhere from 12px to 17px.


2 Answers

Check this out:

Winforms - Adjust width of vertical scrollbar on CheckedListBox

Worth mentioning too:

.NET Compact framework - make scrollbars wider

More of the same, but this time with a better solution through the use of the scrollbar control:

Change the width of a scrollbar

Another one in which the guy teaches how to create your own scrollbar control (interesting):

Set the Scrollbar width of a DataGridView

The last one (worth trying):

Is there a way to get the scrollbar height and width for a ListView control

like image 92
Leniel Maccaferri Avatar answered Oct 04 '22 00:10

Leniel Maccaferri


The easiest way would be to search for scrollbar instances in the form/control's controlcollection and then simply update the width value.

foreach(Control ctrl in dataGridProducts.Controls)
    if (ctrl.GetType() == typeof(VScrollBar))
        ctrl.Width = 100;

This works on Windows CE with dot net compact framework

like image 33
EvoLord Avatar answered Oct 03 '22 23:10

EvoLord