How to get Color Property of UltraLabel

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
sukhmeet032795
Posts: 9
Joined: Tue Jun 14, 2016 3:26 pm

How to get Color Property of UltraLabel

Post by sukhmeet032795 » Tue Jun 28, 2016 12:40 pm

Hi,

We are using Infragistics in our Application. Now we have multiple UltraLabels in our application i.e Infragistics.Win.Misc.Ultralabel. These labels have some Background color which is of certain significance. I want to know the Background Color which each Ultralabel represents. I have googled and gone through the forum, but could not find anything much of significance.

I can't upload the screenshot as it is against company policies.

How can i achieve this?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to get Color Property of UltraLabel

Post by odklizec » Tue Jun 28, 2016 12:46 pm

Hi,

Now this is definitely something you will have to do via InvokeRemotely, as described here:
http://www.ranorex.com/forum/finding-th ... html#p3622
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

sukhmeet032795
Posts: 9
Joined: Tue Jun 14, 2016 3:26 pm

Re: How to get Color Property of UltraLabel

Post by sukhmeet032795 » Tue Jun 28, 2016 1:07 pm

Hi,

It did not work for me. I got the following error.

Action 'invokeremotely' failed on element '{Unknown:ultraPanel2}'.
Object reference not set to an instance of an object.

here is my code ->

Code: Select all

Ranorex.Control elementUltraGrid1 = new Ranorex.Control("/form[@controlname='PranaMain']/element[@controlname='ultraPanel2']");

bool backColor = (bool)elementUltraGrid1.InvokeRemotely(
            	delegate(System.Windows.Forms.Control control, object input){
            		
            		Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid = (control as Infragistics.Win.UltraWinGrid.UltraGrid);
            		Report.Info(ultraGrid.ActiveCell.Appearance.BackColor.ToString());
				    return true;  
            	});

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to get Color Property of UltraLabel

Post by odklizec » Wed Jun 29, 2016 11:56 am

Hi,

In your firts post, you mentioned you are using Infragistics.Win.Misc.Ultralabel but in your code you are using Infragistics.Win.UltraWinGrid.UltraGrid ? My guess is that this is the cause of the error? But as I mentioned, I've never used InvokeRemotely before ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration