LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resizing cell(s9 to fit text in a table

Is it a way to automatically or programmaticaly resize cell(s) size to fit text (as in Excel for example)
0 Kudos
Message 1 of 5
(2,903 Views)
> Is it a way to automatically or programmaticaly resize cell(s) size to
> fit text (as in Excel for example)

There is a popup option to Autosize Row Height, which may do part of
what you want.

If you want to do it programmatically, there is a picture control VI
that will return the size of a piece of text for a given font and
string. You can then set the size of the cell/row/column using a
property node.

Greg McKaskle
0 Kudos
Message 2 of 5
(2,903 Views)
I didn't find the VI you said. Where is it ?

Thank's
Billod Jean-Luc
0 Kudos
Message 3 of 5
(2,903 Views)
H,

I have attached a LV6.1 example.

This uses the caption of another string control to work out the size of the text in the active cell. It obtains the size.width parameter of the caption, with the parameter size to text set True, and writes the result to the active cell size.width. I have only used the text in the first cell of a column but you could obtain the text of a column and work out which is the longest and then set the cell width. The caption text and the the Text of the Table must be the same text size.

Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 5
(2,903 Views)
> I didn't find the VI you said. Where is it ?
>

The picture control VI is located in Graphics and Sound>Picture
Functions, and it is called Get Text Rect.vi.

Greg McKaskle
0 Kudos
Message 5 of 5
(2,903 Views)