Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1180
mouse scroll wheel
posted

How to change the number of lines that the mouse scroll wheel will either rise or fall?

  • 53790
    posted

    Hello,

    Based on the above suggestions you probably could use something like the following:


    public Form1()
    {
        InitializeComponent();
        ultraGrid1.MouseWheel += new MouseEventHandler(ultraGrid1_MouseWheel);
    }

    void ultraGrid1_MouseWheel(object sender, MouseEventArgs e)
    {
        if (e.Delta < 0)
        {
          // Determine how exactly you would like to scroll the UltraGrid.If you are using the code below you will scroll 10 rows up/down
       
            ultraGrid1.DisplayLayout.RowScrollRegions[0].ScrollPosition += 7;
        }
        else
        {
           
           ultraGrid1.DisplayLayout.RowScrollRegions[0].ScrollPosition -= 7;
        }
    }

     Please if you have any questions do not hesitate to ask me.
    Regards

  • 469350
    Offline posted

    Hi,

    This is determined by the mouse driver. The Mouse settings on your machine will usually allow you to specify the number of rows to scroll.

    There is no way to change it for individual controls.

    You might be able to handle the MouseWheel event and either cancel the event and scroll the grid yourself, or else change the number of rows. But I'm not sure if the number is settable or if the event is cancellable.

    Another option would be to derive a control from the grid and override the OnMouseWheel method.

     

  • 69832
    Offline posted

    This is a function of the local machine settings. Assuming your mouse driver supports configuration of this functionality, the Mouse Properties applet has a setting for the number of lines by which to scroll when the wheel is rotated one notch.