cancel
Showing results for 
Search instead for 
Did you mean: 

Get Object Background Color

gindi_khangura
Occasional Contributor

Get Object Background Color

Hi,



Just a question in general; I have an object (window type) that I need to retrieve the background color from.

Using the object spy functionality shows that there is no property that exists for retrieving the background color.



I have searched through the help index and have not found anything pretaining to this.

Is there a TestComplete functionality that I can leverage to retrieve the background color?



We could attempt to take an image of the object and pick certain points on the image to retrieve the pixel colors from, but such a method is not guranteed to be always correct.
4 REPLIES 4
goelkshitij
Not applicable

RE: Get Object Background Color

Hi,



Use the following "Object.currentstyle.backgroundColor" to get the the background color



Thanks
gindi_khangura
Occasional Contributor

RE: Get Object Background Color

The object 'currentstyle' does not exist for the object that I'm attempting to get the property of.
TanyaYatskovska
Community Manager

RE: Get Object Background Color


Hi Gindi,


 


Go through the "Get a control's background color" How To article - it may help you.


 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
manishaw
Regular Visitor

Re: RE: Get Object Background Color

Is that code available in Python?

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors