NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Font Resizing - TSUI.h

Solved!
Go to solution

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 Smiley Sad

 

 

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

0 Kudos
Message 1 of 4
(2,643 Views)

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

www.ni.com/support

0 Kudos
Message 2 of 4
(2,596 Views)

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?

0 Kudos
Message 3 of 4
(2,576 Views)
Solution
Accepted by topic author pinguu

Issue is resolved.

Found out the cause of it. (callback was made to a different tab)

0 Kudos
Message 4 of 4
(2,560 Views)