NUnitForms Class Library

MouseController.Drag Method (PointF, PointF[])

Simulate dragging the mouse.

[Visual Basic]
Overloads Public Sub Drag( _
   ByVal startPoint As PointF, _
   ParamArray points As PointF() _
)
[C#]
public void Drag(
   PointF startPoint,
   params PointF[] points
);

Parameters

startPoint
A PointF to start the drag operation at.
points
Array of PointF structures that represent the points to move> the mouse to.

Remarks

Drag positions the mouse over the control under test at the specified startPoint and then presses the left mouse button. It then moves the mouse to each point specified in the points array. Finally the left button is released.

Exceptions

Exception TypeCondition
ArgumentNullException When points is null.
ArgumentException When points does not contain any elements.

Example

            using (MouseController mouse = new MouseControler(myTestControl))
            {
              mouse.Drag(new PointF(0,0), new Point(100, 100));
            }
            

See Also

MouseController Class | NUnit.Extensions.Forms Namespace | MouseController.Drag Overload List