newguy
Well-known member
Hi all, I am working on getting my FlowLayoutPanel to scroll while dragging - cause it does not work with normal measures. I am trying to use a Do Loop which works 'cept that I can get it to stop the loop for a condition. The condition if based on the position of the cursor - so when it is < 120 scroll up, but if they move the cursor > 120 stop scrolling. 120 being near the top of the FLP. Right now it will continue all the way to 0 b/f stopping. I have tried several variations. Any ideas?
VB.NET:
If e.Data.GetDataPresent("myObject") Then
Dim x As Point = Me.PointToClient(Cursor.Position)
Do While x.Y < 120
vsFLP.Value -= 1 ' my custom scrollbar
Thread.Sleep(50) ' cause it scrolls fast
Loop
....
End If