From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the Font style in an XControl- String- Indicator

I made an XControl from a string indicator, which behaves like a Link in an Internet Browser window (underline on mouse-enter). I can change the color of the indicator as expected with the coloring tool, but when I change the Font Settings with the appropriate Dialog (Ctrl+0), the changes are not applied.
  1. Why that?
  2. How can I access the settings made in the Fonts dialog to apply them to my XControl?
I know that I can pass new font settings via property node, but I'd like it the nice way. Any suggestions?

greets, Dave
Greets, Dave
0 Kudos
Message 1 of 3
(2,407 Views)
An XControl is not the same as a native LV control.

Try to think of an XControl as more of a VI in a frameless subpanel with a block diagram control input instead of a connector pane...

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 2 of 3
(2,393 Views)
If you'd show the label of the XControl, you'll notice the label does change to the selected font.


However, the string inside the XControl is "shielded" by the XControl container. So the font will not change. That is one of the biggest backdraws of using an XControl. Once you decide to do things yourself, you have to do everything yourself...


Try this. Get the XControl's reference from the Container State (inside the XControl). Read it's font with the Label.Font. Use this information to update the font of the controls inside the XControl. I did not find any event inside the XControl that is fired when you change the font, so you need to improvise on that.


Hope it helps,


Wiebe.



Message 3 of 3
(2,389 Views)