[DllImport (" user32. DLL, "EntryPoint=" GetScrollPos ")]
Public static extern int GetScrollPos (IntPtr HWND, int nBar);
Private void button1_Click (object sender, EventArgs e)
{
//one. Get the position of the vertical scroll bar
Int I=GetScrollPos (enclosing listView1. Handle, 1);
//2. The difficulty in this step, how to achieve a listView1 controls the length of the scroll bar area
int b=1;
Judging//3.
If (I==b)
{
MessageBox. Show (" bottom ");
}
}
Through the first step to get to the position of the scroll bar, the difficulty in the second part, how to know the position is located in the bottom of the control?
I want to achieve a result, is to realize the text frame's refresh, if the position is located in the bottom of the scroll bar, I'll focus will automatically update to the latest text, if the position is not in at the bottom of the scroll bar (is drag the scroll bar to view the front data), I will not update the focus,
To achieve this effect must be able to real-time to determine whether a scroll bar at the bottom, consult everybody a great god,
CodePudding user response:
Pull the scroll bar to the bottom, seeGetScrollPos (this) listView1) Handle, 1)the value of the len, if less than I len is not the end
CodePudding user response: