Micro Focus QTP (UFT) Forums
Getting the Font Properties of WPF controls - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Getting the Font Properties of WPF controls (/Thread-Getting-the-Font-Properties-of-WPF-controls)



Getting the Font Properties of WPF controls - sreejithmahesan - 05-26-2011

Hi,

How to get the font properties ( Color, Size, Bold , Italic ... ) of a text inside a WpfEdit control.

What I am using is :" WpfWindow("TruBioPC").WpfEdit("NotesTextarea").Object.FontSize
which returns the font size.

But I need to get the other properties.


Code:
WpfWindow("TruBio PC").WpfEdit("NotesTextarea").Object.Foreground
WpfWindow("TruBio PC").WpfEdit("NotesTextarea").Object.FontStyle
WpfWindow("TruBio PC").WpfEdit("NotesTextarea").Object.FontFamily
WpfWindow("TruBio PC").WpfEdit("NotesTextarea").Object.FontWeight

All of these return empty values.

Any help appreciated...

Thanks in advance


RE: Getting the Font Properties of WPF controls - lyssagale12 - 06-23-2011

Hi Smile Thank you for sharing nice information with us.

Lyssa Gale
Classic Fonts