NUnitForms Class Library

MouseController.Drag Method (Single, Single, Single[])

Simulate dragging the mouse.

[Visual Basic]
Overloads Public Sub Drag( _
   ByVal startX As Single, _
   ByVal startY As Single, _
   ParamArray points As Single() _
)
[C#]
public void Drag(
   float startX,
   float startY,
   params float[] points
);

Parameters

startX
A Single x-coordinate to start the drag operation at.
startY
A Single y-coordinate to start the drag operation at.
points
Array of Single values that represent the x and y coordinates to move> the mouse to.

Remarks

Drag positions the mouse over the control under test at the specified PointF(startX, startY) 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 at lease two values,
Or, the number of elements is odd.

Example

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

See Also

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