Syncfusion.Shared.Base
Members  Example 


Syncfusion.Windows.Forms Namespace : IntelliMouseDragScroll Class

IntelliMouseDragScroll Class

Implements support for Intelli-Mouse panning. When the user presses the middle mouse button and drags the mouse, the window will scroll. ScrollControl has built-in support for this call. You only have to enable ScrollControl.EnableIntelliMouse.
Object Model
IntelliMouseDragScroll ClassIntelliMouseDragScroll Class
Syntax
'Declaration
 
Public Class IntelliMouseDragScroll 
   Inherits Syncfusion.ComponentModel.NonFinalizeDisposable
'Usage
 
Dim instance As IntelliMouseDragScroll
public class IntelliMouseDragScroll : Syncfusion.ComponentModel.NonFinalizeDisposable 
Example
The following code enables support for IntelliMouseDragScroll:
public bool EnableIntelliMouse
    {
        get
        {
            return imm != null and imm.Enabled;
        }
        set
        {
            if (value != EnableIntelliMouse)
            {
                if (imm == null)
                {
                    imm = new IntelliMouseDragScroll(this, true);
                    imm.AllowScrolling = ScrollBars.Both;
                    imm.DragScroll += new IntelliMouseDragScrollEventHandler(IntelliMouseDragScrollEvent);
                }
                imm.Enabled = value;
            }
        }
    }
            
    void IntelliMouseDragScrollEvent(object sender, IntelliMouseDragScrollEventArgs e)
    {
        int dy = e.Dy;
        int dx = e.Dx;
            
        this.disableAutoScroll = true;
        if (Math.Abs(dy) > Math.Abs(dx))
        {
            VScrollBar.SendScrollMessage(dy > 0 ? ScrollEventType.SmallIncrement : ScrollEventType.SmallDecrement);
        }
        else
        {
            HScrollBar.SendScrollMessage(dx > 0 ? ScrollEventType.SmallIncrement : ScrollEventType.SmallDecrement);
        }
        this.disableAutoScroll = false;
    }
Inheritance Hierarchy

System.Object
   Syncfusion.ComponentModel.NonFinalizeDisposable
      Syncfusion.Windows.Forms.IntelliMouseDragScroll

AssemblyVersion

Syncfusion.Shared.Base: 17.3460.0.26

See Also