Is there a way to find out alignment of labels?

Class library usage, coding and language questions.
User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Is there a way to find out alignment of labels?

Post by artur_gadomski » Thu Jul 29, 2010 1:31 pm

Hi
I looked around and could not find it but maybe I've been looking in wrong place. Is there a way to get an alignment of text in a static text control?
I want to test a layout of windows with a bunch of labels. I tested alignment of ScreenRectangles of each text box but text inside might be aligned to the left or right or middle.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Is there a way to find out alignment of labels?

Post by Support Team » Thu Jul 29, 2010 2:29 pm

Hi,

Sorry but such property is not available at the moment. You can use the image based automation to validate if the text has the correct alignment. Please take a look to following documentation
http://www.ranorex.com/support/user-gui ... ation.html

Regards,
Peter
Ranorex Team

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Is there a way to find out alignment of labels?

Post by artur_gadomski » Fri Jul 30, 2010 6:47 am

That's not really an option for me since I'm dealing with 200+ different windows each of them having 5-20 text labels that often don't repeat between windows.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Is there a way to find out alignment of labels?

Post by Support Team » Fri Jul 30, 2010 11:48 am

Hi,

There is another solution for WinForms, but this is solely for WinForms and the element must have the adapter control. For example for a Label
Ranorex.Text yourItem= "PathToElement";
Ranorex.Control cont = new Ranorex.Control(yourItem);
cont.GetPropertyValue("TextAlign");
Regards,
Peter
Ranorex Team