开发者

Modify scroll speed, treeview drag&drop in C#

开发者 https://www.devze.com 2022-12-25 04:38 出处:网络
i have a treview control with drag&drop functionality that response to draw the node outside the visible limits scrolling in the apropiate direction. The problem is that it 开发者_StackOverflowscr

i have a treview control with drag&drop functionality that response to draw the node outside the visible limits scrolling in the apropiate direction. The problem is that it 开发者_StackOverflowscroll at light speed. I need a way to modify this speed.


You should use a Timer. Enable it when you detect the item getting dragged near the top or bottom of the client area. Simply avoiding scrolling when the timer is busy. The Interval property of the timer determines how fast the scrolling takes place. A bonus effect is that the user can speed up the scrolling by waving the dragged item up-and-down.

I wrote some sample VB.NET code that uses this approach, you'll find it in this thread.

0

精彩评论

暂无评论...
验证码 换一张
取 消