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# ?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Nov 20, 2014, 2:03 AM EST
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
Selva GanapathyRank #560 · 4.3K reputationPosted Nov 20, 2014, 2:31 AM EST
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
Ashok Yadav184 reputationPosted Nov 20, 2014, 7:00 PM EST
Ashok Yadav184 reputationPosted Nov 20, 2014, 7:01 PM EST