Ask a Question

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

Hi,



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



Thanks
gindi_khangura
Occasional Contributor

The object 'currentstyle' does not exist for the object that I'm attempting to get the property of.
TanyaYatskovska
SmartBear Alumni (Retired)


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



Is that code available in Python?

cancel
Showing results for 
Search instead for 
Did you mean: