02-23-2017 12:00 PM
I'm trying to change the font size when a caption has been updated inside a label box.
The properties image allows me to change the font size to 39.75 as shown; however, it seems that when I do a post to the caption, the size gets set to a default value.
I checked to make sure that the font source is still set to 0 (FontSource_UseFontProperty).
Now, interestingly enough, I'm able to set the fore color of the caption, but any other attributes doesn't work. For example: TSUI_LABELSETENABLE.
Does anyone ever have the same situation? I've looked through the forumn and online and it doesn't seem to have information.
Side note: It seems that NI doesn't support Vertical Align properties yet either
Also:
To avoid having a long initial post, I did the following:
tsErrChk( TSUI_LabelSetCaption (gSocketWindow.statusLabel[(int)currentPanel], NULL, statusMessage.StatusMsg));
tsErrChk( TSUI_LabelSetBackColor (gSocketWindow.statusLabel[(int)currentPanel], NULL, 0xFF));
tsErrChk( TSUI_LabelSetForeColor (gSocketWindow.statusLabel[(int)currentPanel], NULL, 0x00F));
tsErrChk( TSUI_LabelSetFontSource (gSocketWindow.statusLabel[(int)currentPanel], NULL, 0));
The first 3 steps would work, but the 4th one doesn't.
And it may be because it's an ActiveX control that it's causing the issue
Solved! Go to Solution.
02-24-2017 08:38 AM
Good Morning b1ack1otus,
From what I can see, it looks like your properties are set correctly. I am guessing the reason that the font color works but the other font properties do not is because the fore/back color is a different property than the font source.
Can you try changing FontSource_UseFontProperty to one of the other values shown in the link below? Is that able to change your font or do none of the properties work right now?
TestStand Help- FontSource Property
Regards,
Hannah
Applications Engineering
National Instruments
02-28-2017 08:37 AM - edited 02-28-2017 08:39 AM
Hi Hannah,
Sorry for the late response. However, using other property, it seems like it does change the font and font size.
tsErrChk( TSUI_LabelSetFontSource (gSocketWindow.statusLabel[(int)indexPanel], NULL, 2));
I used FontSource property 2 (see attached image)
You are correct that the font color works because it's not part of the font source property. Is there a workaround for this?
03-01-2017 11:57 AM
Issue is resolved.
Found out the cause of it. (callback was made to a different tab)