how to perform a mouse operation

Class library usage, coding and language questions.
arishahsan
Posts: 26
Joined: Thu Jan 18, 2007 12:04 pm

how to perform a mouse operation

Post by arishahsan » Thu Mar 08, 2007 6:01 am

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.

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Thu Mar 08, 2007 7:49 pm

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

arishahsan
Posts: 26
Joined: Thu Jan 18, 2007 12:04 pm

it didnt work

Post by arishahsan » Sat Mar 10, 2007 3:33 pm

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.

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Sat Mar 10, 2007 6:45 pm

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