01-04-2012 04:00 PM
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,
01-05-2012 04:43 AM
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?