Page 1 of 1

how to perform a mouse operation

Posted: Thu Mar 08, 2007 6:01 am
by arishahsan
actually I want to draw a rectangle in an editor which is similar to microsoft paint ... but the problem is that I dont have control name of the editor and so I want to go for the co-ordinates of the editor . So could you suggest me some method to perform this task.

Posted: Thu Mar 08, 2007 7:49 pm
by webops
Use the Mouse.MoveToControl() method to move the mouse to a point relative to the upper-left corner of the control.

The following code draws a rectangle in paint:

Code: Select all

control = form.FindControlName("ControlName");

Mouse.MoveToControl(control, new Point(10, 10));
Mouse.ButtonDown(MouseButtonType.LeftButton);

Mouse.MoveToControl(control, new Point(400, 300));
Mouse.ButtonUp(MouseButtonType.LeftButton);
Gabor
Ranorex Team

it didnt work

Posted: Sat Mar 10, 2007 3:33 pm
by arishahsan
actually there is no such method
Mouse.MoveToControl(CyCanvas, new Point(400, 300));
...I have method to Mouse.MoveToControl(CyCanvas);
can u tell me in which version this method is available.
I am using Ranorex-0.9.2.

Posted: Sat Mar 10, 2007 6:45 pm
by webops
arishahsan wrote:can u tell me in which version this method is available.
You need the version V1.1.0.
The version should be compatible with the V0.9.2

Gabor
Ranorex Team