How do I know the current width of system scrollbar?

前端 未结 4 1084
长情又很酷
长情又很酷 2020-12-08 12:43

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\'

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 13:18

    Skip the ClientSize property of the control. At least in VS2013 the Scrollbar is included in the ClientSize.

    When I formatted a RichTextBox with a width of 304 and a vertical scrollbar, the Client Size width was 300, which only accounted for the borders.

    stick with the System.Windows.Forms.SystemInformation.VerticalScrollBarWidth to get your scrollbar width.

提交回复
热议问题