LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatic ListBox text changes

Hi All,

anyone know how to modify the text (font, size, justification, etc.) in a
listbox programmatically.

Thanks in advanced

Denis Jolivet


0 Kudos
Message 1 of 5
(3,364 Views)
Changing the list of items is simple, call a property node on the reference to the ListBox and modify the "ItemNames" property. This property takes a string array containing a list of string items to use in the list (note this is different than the value property). As far I know there is not a property to change an individual font/size/justification of a listbox item. String controls however do allow for adjustment of such parameters at runtime using properties nodes. I didn't see any property for changing the font on a listbox, and I am not sure why this was not included.
-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 5
(3,361 Views)
Thanks for the response.

I guess it isn't possible to do it programatically.

Too bad, I would like to change the font on about a 100 cells. I guess I
will have to do in manually..

Seems like an oversite on NIs part

Denis


"falkpl" <x@no.email> wrote in message news:188364@exchange.ni.com...
> Changing the list of items is simple, call a property node on the
> reference to the ListBox and modify the "ItemNames" property. This
> property takes a string array containing a list of string items to use in
> the list (note this is different than the value property). As far I know
> there is not a property to change an individual font/size/justification of
> a listbox item. String controls however do allow for adjustment of such
> parameters at runtime using properties nodes. I didn't see any property
> for changing the font on a listbox, and I am not sure why this was not
> included.<br>-Paul


0 Kudos
Message 3 of 5
(3,345 Views)
There is one work around however, but it is not the most elegant, use an activeX based listbox, I have a forms2.0 Listbox from microsoft that is robust than the one from NI. Here you can change the font of the listbox as well as many other members. Using activeX will cost you ease of programming and portability of the code and can make it slightly more difficult to distribute, so factor this in when doing the cost-benefit analysis of using this approach. If this is a must have feature (probably is not) you can play around with the active MS Listbox control. In labview 7.0+ you can now do activeX event callbacks so event handling still can be accomplished.
-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 5
(3,342 Views)

How to get text of the selected item in the list box?

0 Kudos
Message 5 of 5
(2,774 Views)