BackColor Attribute?

Class library usage, coding and language questions.
bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

Re: BackColor Attribute?

Post by bsing » Wed Mar 07, 2012 2:21 am

Yes thankyou! this works. Although your second line needs to have <Ranorex.Control> instead of just <Control>

amruta jatti
Posts: 1
Joined: Mon Jun 09, 2014 4:10 pm

how do I get tabpage (flex Object) Color ?

Post by amruta jatti » Mon Jun 09, 2014 6:30 pm

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

winniethedragon
Posts: 6
Joined: Wed May 27, 2015 9:22 am

Re: BackColor Attribute?

Post by winniethedragon » Wed May 27, 2015 10:07 pm

I am getting the same "Object reference not set to an instance of an object." error...

Anyone resolves this?

Thanks!
Winnie

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: BackColor Attribute?

Post by Support Team » Fri May 29, 2015 6:26 pm

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
.
Image