Current location - Loan Platform Complete Network - Big data management - How to get and set the current position of vertical scrollbar of dataGridView1 in C# winform program?
How to get and set the current position of vertical scrollbar of dataGridView1 in C# winform program?
This function can be realized by pulling the water

level and vertical scrollbars, but in practice

users tend to drag the page directly with the mouse

marker, and a lot of graphical

software has this kind of similar function. The .ne

t print preview control unfortunately does not

provide this function, only to find their own

to realize it.

However, there is always a way.

My approach is to use code to control

print preview control in the horizontal to vertical scroll

the position of the bar, and indirectly realize and use the mouse

directly drag the scroll bar the same effect.

In the process of implementing this functionality,

the biggest difficulty was that the print preview control did not

have any methods or properties that the programmer could call directly on the scroll

bar. So I had to turn to Wi

nAPI for help

.