Change width of scrollbars

大兔子大兔子 提交于 2020-01-28 02:12:17

问题


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!


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/4593915/change-width-of-scrollbars

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!