LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String controls/indicators

I have a string control/indicator with different paragraphs of text in it. I want to change programmatically,so in run-time,the font/size etc... of a just one paragraph without influencing the others. Can someone tell me how to do this, maybe with some examples.
Davy
0 Kudos
Message 1 of 4
(2,917 Views)
> I have a string control/indicator with different paragraphs of text in
> it. I want to change programmatically,so in run-time,the font/size
> etc... of a just one paragraph without influencing the others. Can
> someone tell me how to do this, maybe with some examples.

You don't say what version of LV you have, but considering it is fairly
recent, here is how you do this. The property node for a string lets
you set the text selection, and it lets you change font characteristics.
You first need to find the offsets to your paragraph, first character
offset is 'F' and last is 'L'. Set the text selection to 'F' and 'L',
and any font changes, color changes you make to the text will not be
limited to the selection.

The main properties you are lookin
g for is the Text> in below the third
separator in the menu. It contains both selection and Font>.

Greg McKaskle
Message 2 of 4
(2,917 Views)
Use an Active X control like Microsoft Rich Textbox control.
On your front panel, from the Active X palette, select Container.
Right-click in the container and select Insert ActiveX Object.
Scroll through the list until you find an object (like Microsoft Rich Textbox) which supports mulitple fonts.
Right-click in the container (now a Richtext control), and select Create >> Property Node.
For the Microsoft Rich Textbox, you can change the font of selected text, but you have to specify the selection start and length.
See the attached LabVIEW 6.1 example.
Message 3 of 4
(2,917 Views)
I wrote this example a long time ago. It changes the color of text but the programmer can choose to change the font instead. The VI uses the method Greg discribes.
Message 4 of 4
(2,917 Views)