How to Drag panel scroll slowly when we movec ontrol of that
How to Drag panel scroll slowly when we movec ontrol of that panel up or down in c# ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ashok YadavPosted Nov 21, 2014, 12:01 AM
Ashok YadavPosted Nov 21, 2014, 12:00 AM
Selva GanapathyPosted Nov 20, 2014, 7:31 AM
Hi Ashok,
You can make use of following code to for drag panel that move the control up and down accoring to the cursor position.
protected override void OnMouseMove(MouseEventArgs e)
{
if (e.Location.Y > this.Height / 2)
this.VerticalScroll.Value = this.VerticalScroll.Value + 10;
else
if (this.VerticalScroll.Value > 10)
this.VerticalScroll.Value = this.VerticalScroll.Value - 10;
base.OnMouseMove(e);
}
Regards,
Selva Ganapathy K
Manish Kumar ChoudharyPosted Nov 20, 2014, 7:03 AM
Hi ashok yadav,
Read these links it may be helpful for you
http://www.codeproject.com/Articles/226381/Scrolling-Panel
http://stackoverflow.com/questions/8543802/set-autoscroll-position-on-mouse-move