scroll the buttons with mouse wheel

2 posts, 0 answers
  1. Farshad
    Farshad avatar
    1 posts
    Member since:
    Jun 2013

    Posted 04 Jun 2013 Link to this post

    Hi:

    I am using RadPageView Backstage mode, As I have many buttons in my element bar, I am using StripButtons for scrolling among them. I want to use mouse Wheel for scrolling among the Items. 

    Is there anyway to do that? 

    Sincerely
    Farshad Zamani
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 07 Jun 2013 Link to this post

    Hi Farshad,

    Thank you for writing.

    You should handle the RadPageView's MouseWheel event and call ScrollButton's PerformClick in this event.
    For example:
    public Form1()
    {
        InitializeComponent();
        this.radPageView1.MouseWheel += new MouseEventHandler(radPageView1_MouseWheel);
        ((RadPageViewBackstageElement)radPageView1.ViewElement).StripButtons = StripViewButtons.Scroll;           
    }
     
    void radPageView1_MouseWheel(object sender, MouseEventArgs e)
    {
        if (e.Delta > 0)
        {
            ((RadPageViewBackstageElement)radPageView1.ViewElement).ItemContainer.ButtonsPanel.ScrollLeftButton.PerformClick();
        }
        else
        {
            ((RadPageViewBackstageElement)radPageView1.ViewElement).ItemContainer.ButtonsPanel.ScrollRightButton.PerformClick();
        }
    }

    I hope this helps.

    Regards,
    Peter
    Telerik
    RadChart for WinForms is obsolete. Now what?
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top