LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select item by default in 2 listbox?

Hello,

I want 3 question about listbox.

 

1- How i get the second listbox by default to enable the first item selected (if it exist)?. I select in the listbox 1 the client and in the lower listbox show the files of this client, but I want automatically the first file of client is selected for default.

 

2-Is it possible to remove the white pointed square in selected item?. It only shows in the first column. I would like to have only the highlight of selected item and remove the white square.

 

3- How i can remove the empty columns like in example?.

 

Regards.

0 Kudos
Message 1 of 7
(3,778 Views)

Hi Fonsi,

 

Sorry I have no idea about question 1&2.

 

But I have "stupid" solution for question 3.

 

I have done this before, you can use property node to autosize your dececorates and cover those empty column.

 

It is not good solution I know Smiley Sad

 

 

Decorations.PNG

 

Patrick

Certified LabVIEW Developer
0 Kudos
Message 2 of 7
(3,755 Views)
1. By default, the value of a listbox is the number of the row that is selected. To select the first row programmatically write a 0 to the value property.

2.There is an option in the shortcut menu to Show Selection. By default it is on. Select it to turn it off.

3. The way to do this is with properties. There a property that allows you to select the specific number of rows visible.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 7
(3,744 Views)

Thanks Patrick and Mike for anwers!

 

Mike, for each case:

 

1- Yes, I know if I execute the vi, by default the first item is seleted in both listbox. But If I select other item in listbox 1 the listbox2 no show any selected item. I can use a property node to select value 0, but then I can't choose between the list of items in listbox2.

I would like when I select any item in listbox1 the listbox2 appear selected the first item BUT after I could choose the others... I hope you can understand me.

 

2- I dont find the shortcut for that. Can you show me please?.

 

3- ok, it fit the column or rows to be visible, but I meant delete the empty columns, in this case it only uses 8 columns the rest of columns is not requerided. I solve creating another one new. in this example it only take 8 columns (listbox2).

 

Thanks for help.

 

0 Kudos
Message 4 of 7
(3,725 Views)

I just get one solution for case 1.

Event structure to check when the value of listbox1 change fit the listbox selection to first item.

I dont know if there is a simple way to do it. But it works.

 

Fred

0 Kudos
Message 5 of 7
(3,711 Views)

Hi Fonsi,

 

Click the stop button and program cannot stop.

 

I think the event loop should add the timeout.

 

 

Patrick

 

 

Certified LabVIEW Developer
0 Kudos
Message 6 of 7
(3,698 Views)

Yes Patrick,

In my project the listbox goes inside of event structure and finally I put this:

 

even structure

 

0 Kudos
Message 7 of 7
(3,687 Views)