Search code examples
c#winformsscrolluser-controls.net-1.1

How to get usercontrol HorizontalScroll or VerticalScroll value in .Net 1.1


I am using .Net Framework 1.1 for developing the usercontrol. whenever the data exceeding above AutoScrollMinSize then scrollbar has appeared. In .Net 1.1 I can't find any event for scroll and can't get scroll value also.

In .Net 2.0 or above , we have HorizontalScroll or VerticalScroll properties . Based on these properties we can get the scroll value. But , In .Net 1.1 can't find any properties or methods to get the scroll value.


Solution

  • You need to work with the AutoScrollPosition property (bit.ly/2qZrtpN). To detect changes to the auto-generated scrollbar, the only way to do that in 1.1 is to create an event handler for the Paint event. This documentation (bit.ly/2vNPmWt) is for 2.0 but should apply also to 1.1.