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,646 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...
Message 2 of 3
(2,632 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,628 Views)