Page 2 of 2
Re: BackColor Attribute?
Posted: Wed Mar 07, 2012 2:21 am
by bsing
Yes thankyou! this works. Although your second line needs to have <Ranorex.Control> instead of just <Control>
how do I get tabpage (flex Object) Color ?
Posted: Mon Jun 09, 2014 6:30 pm
by amruta jatti
Hi,
I have Tabpage object ,it has Grey color I need to get color of the tabpage ,its type of flex object.
I tried following code for tabpage object but it didn't worked.
Text text = "/form[@controlname='frmMain']/container/container/element/container/container/text[@controlname='txtDetails']";
Color color = (Color) text.As<Control>().GetPropertyValue("BackColor");
Text text = "/form[@controlname='frmMain']/container/container/element/container/container/text[@controlname='txtDetails']";
Color color = (Color) text.As<Control>().GetPropertyValue("BackColor");
its throwing exception "Object reference not set to an instance of an object".
Plz help me....
Regards
Amruta
Re: BackColor Attribute?
Posted: Wed May 27, 2015 10:07 pm
by winniethedragon
I am getting the same "Object reference not set to an instance of an object." error...
Anyone resolves this?
Thanks!
Winnie
Re: BackColor Attribute?
Posted: Fri May 29, 2015 6:26 pm
by Support Team
Hi Winnie,
May I ask you to post a Ranorex snapshot file of the element you want to get the color from?
The following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.
Do you use the exact same code or another one?
Thanks,
Markus