【问题标题】:Change width of scrollbars更改滚动条的宽度
【发布时间】:2011-06-03 09:29:34
【问题描述】:

我正在开发一个触摸屏程序。我正在使用 c# 和 Visual Studio 2008。有没有办法改变滚动条的宽度?我知道我可以更改 Windows 的显示属性。但我只想在我的程序中而不是在完整的系统中。谢谢你的帮助!

【问题讨论】:

    标签: c# windows resize size scrollbar


    【解决方案1】:

    看看这个:

    Winforms - Adjust width of vertical scrollbar on CheckedListBox

    也值得一提:

    .NET Compact framework - make scrollbars wider

    更多相同,但这次通过使用滚动条控件提供了更好的解决方案:

    Change the width of a scrollbar

    另一个人教你如何创建自己的滚动条控件(有趣):

    Set the Scrollbar width of a DataGridView

    最后一个(值得一试):

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

    【讨论】:

      【解决方案2】:

      最简单的方法是在表单/控件的 controlcollection 中搜索滚动条实例,然后简单地更新宽度值。

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

      这适用于带有 dot net compact 框架的 Windows CE

      【讨论】:

        猜你喜欢
        • 2016-11-24
        • 2014-01-13
        • 2011-02-03
        • 1970-01-01
        • 1970-01-01
        • 2016-06-25
        • 2011-12-20
        相关资源
        最近更新 更多