LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Listbox (Container) Sizing

Solved!
Go to solution

Folks -

 

I want to have listbox height stay constant regardless of the number or rows I programmatically set.  And also want to see an ACTIVE vertical scrollbar for the listbox so I can scroll to row of choice.  I tried various things with property nodes and tried to rig something up by placing the listbox inside of a cluster.  I have not come across a satisfactory solution so far.  Any help is appreciated.

 

Sincerely,

 

Don

0 Kudos
Message 1 of 7
(3,845 Views)
I don't understand the question. Why would the listbox height be changing based on the number of rows? The height is a function of the physical size of the control, not the number of items in the listbox.
0 Kudos
Message 2 of 7
(3,843 Views)
If you change the number of rows programmatically, the listbox expands to show you the new number of rows.  I don't want this to happen.  I want to use the vertical scrollbar to move up and down to the row that I want, and want the control itself to stay of constant height (1 row high).
0 Kudos
Message 3 of 7
(3,841 Views)
Solution
Accepted by DonRoth
Sorry, misunderstood your question. Well, if you're setting the number of rows then obviously the control will resize to do exactly what you told it to do. This is by design, and makes perfect sense. Use the TopRow property instead.
0 Kudos
Message 4 of 7
(3,835 Views)

Yes, this does the trick and thanks. The top row property for listboxes is similar to using the Index Values for setting the array index for arrays.  (There, one uses a single value wired to a build array fx and then wired to Index Values property node to set the index.)

 

I would take issue that number of rows should visibly expand the size of the box.  There could be an autosizing property.  The vertical scrollbar could be used to allow user access to any of the rows.

 

Sincerely,

 

Don 

Message Edited by DonRoth on 01-22-2009 11:34 AM
0 Kudos
Message 5 of 7
(3,830 Views)

Glad that answered your quesiton.

 

I can see your point of view regarding the number of rows. I don't agree with it, but I don't think it's wrong. You may want to consider providing a comment in the Product Suggestion Center.

0 Kudos
Message 6 of 7
(3,824 Views)
I think that by default, it is reasonable to have it auto-expand.  But it would be nice to have a property node so that you can override that.  I don't know if it is important enough for the product suggestion center since we have the workaround now.  But thanks.....Don
0 Kudos
Message 7 of 7
(3,804 Views)