Showing results for 
Search instead for 
Did you mean: 

Set ATTR_TEXT_FONT in a text box




I am trying to programmatically set the text font to "Courier" for a text box using SetCtrlAttribute and the attribute ATTR_TEXT_FONT, but it does not appear to have any impact.  The text box was created in the .uir file.


I looked thorough software in my company’s re-use repository and noticed that whenever ATTR_TEXT_FONT was used, it was immediately after programmatically creating the control/indicator.  Is it possible to programmatically set the font for a control/indicator that was created in an .uir file?  Unfortunately, I am not permitted to change the font in the.uir file so I need to change it programmatically.


Any suggestions would be appreciated.  Thank you,


0 Kudos
Message 1 of 2

Hello Christine, the attribute you are using is the correct one to use to change the font in the control so the problem must depend on some other aspect. Does the function call return any error? Also, are you setting the font in a classic-style textbox or in a Lab-style one? And is the panel Use Windows Visual Style For Controls attribute set or not?

"Courier" font is normally found on every system, but are you sure in your actual system it is present? And what happens if you use some of the CVI-defined fonts?

Finally, can you try this same thing with a small sample project just to be sure the problem is not system related but it is rather confined to your actual project?

Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2