Page 1 of 1

How to click a MFC Element

Posted: Mon Jul 04, 2011 9:02 am
by vengaishiva
Hi,
I have a MFC date control in my application. Ranorex identifies it as 'Element'. I want to click the Element through code. But there is no method Click for Element class. How can achieve clicking on that element?

Code is like this:
Element ele = "rxpath of element";
ele.Click() //How to achieve this?

Regards,
Siva R S

Re: How to click a MFC Element

Posted: Mon Jul 04, 2011 10:25 am
by sdaly
You could try ele.InvokeAction("Click", null); or declare as Ranorex.Unknown rather than Element.

Re: How to click a MFC Element

Posted: Mon Jul 04, 2011 10:51 am
by Support Team
sdaly wrote:ele.InvokeAction("Click", null);
That InvokeAction will not work, but as you said using Ranorex.Unknown instead of Element does :-)
Ranorex.Unknown ele = "rxpath of element";
ele.Click()
Regards,
Alex
Ranorex Team

Re: How to click a MFC Element

Posted: Mon Jul 04, 2011 11:36 am
by vengaishiva
Thanks a lot.
Ranorex.Unknown worked :D