Good day!

There was such a problem - I can’t find any clues or any documentation anywhere. How can I find out the width and height of the slider in ScrollBar. How to scroll it down to the end programmatically in C #?

Thank you in advance.

  • 2
    Check WPF or Windows Forms - Modus
  • WindowsForms - pelmeshka80

1 answer 1

The dimensions associated with the scrollbar can be found in System.Windows.Forms.SystemInformation , specifically in HorizontalScrollBarThumbWidth and in VerticalScrollBarThumbHeight . And besides, the Windows API function GetSystemMetrics with the parameters SM_CXHTHUMB and SM_CYVTHUMB gives the same values.

By scrolling. If this is a ScrollableControl and it has the AutoScroll property AutoScroll to true , then a change to HorizontalScroll.Value and VerticalScroll.Value should cause scrolling. Plus, there is still the possibility to send SendMessage with WM_VSCROLL .

  • more than I expected) Plus) - pelmeshka80