Showing results for 
Search instead for 
Did you mean: 

Get Object Background Color

Occasional Contributor

Get Object Background Color


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.
Not applicable

RE: Get Object Background Color


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

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.
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. ⬇️⬇️⬇️
Regular Visitor

Re: RE: Get Object Background Color

Is that code available in Python?

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