This is a migrated thread and some comments may be shown as answers.

RadVScrollBar Not Scrolling On Mouse Wheel event

1 Answer 77 Views
Form
This is a migrated thread and some comments may be shown as answers.
Dan Harvey
Top achievements
Rank 2
Dan Harvey asked on 31 Aug 2009, 09:56 PM
Hello,

I have a scrollbar on a radform and it works just fine except when you try scrolling using the mouse wheel.  Does anyone have any suggestions? I wasn't sure on how to use the RadVScrollBar1_MouseWheel event.  Please advise.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 01 Sep 2009, 01:16 PM
Hello dan harvey,

Just like the standard MS VScrollBar our scrollbar doesn't scroll on MouseWheel event. However, you can implement this functionality by using a few lines of code:

void radVScrollBar1_MouseWheel(object sender, MouseEventArgs e) 
    if (e.Delta < 0) 
    { 
        if (this.radVScrollBar1.Value < this.radVScrollBar1.Maximum) 
        { 
            this.radVScrollBar1.Value += this.radVScrollBar1.SmallChange; 
        } 
    } 
    else 
    { 
        if (this.radVScrollBar1.Value > this.radVScrollBar1.Minimum) 
        { 
            this.radVScrollBar1.Value -= this.radVScrollBar1.SmallChange; 
        } 
    } 

I hope this helps. If you have any other questions, don't hesitate to write back.

All the best,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Form
Asked by
Dan Harvey
Top achievements
Rank 2
Answers by
Jack
Telerik team
Share this question
or