LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple selection in listbox without using ctrl key

Solved!
Go to solution
Just Kidding
0 Kudos
Message 11 of 23
(2,902 Views)

Thanks for the solution.

However it seems like there is still have a problem.

 

When we double click. It will deselect others too. 

0 Kudos
Message 12 of 23
(2,103 Views)

Hi chowsl,

 

However it seems like there is still have a problem.

When we double click. It will deselect others too. 

Then you made something different than what was done 8 years ago…

As you didn't attach your VI you need to debug your code on your own.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 23
(2,094 Views)

GerdW wrote:

Then you made something different than what was done 8 years ago…

As you didn't attach your VI you need to debug your code on your own.


I just download from the provided solution and didn't made any different.

 

Anyway, I had solve the problem. And, here is my own solution.

 

 

0 Kudos
Message 14 of 23
(2,090 Views)

Hi chowsl,

 

why do you use a "mouse up" event? This most often is wrong!

Why don't you use the "value change" event to handle user actions? Then just compare old and new value to control the selected items…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 23
(2,083 Views)

Hi GerdW,

 

If I use "value change", it could not deselect the last value (No value change occur).

 

"Mouse up" will go wrong if clicking at scroll bar area. That's why I calculate and limit the available click area.

 

If you have better solution, please do share your VI too.

Thanks.

 

Best regards,

ChowSL

0 Kudos
Message 16 of 23
(2,086 Views)

Hi chowsl,

 

that's a good point!

(But you should set your listbox to "0 or more items" selection mode instead of "1 and more"…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 23
(2,079 Views)

@CHOWSL wrote:

 

If I use "value change", it could not deselect the last value (No value change occur).

 


  • Value change is the correct event. But yes, the selection mode needs to be set to "0 or more items".
  • Now you can deselect any selected row, even the last one with ctrl-click.
  • You need an event for the stop button.
  • It is annoying if the front panel and diagram windows are saved maximized to the screen.

@CHOWSL wrote:

 

If you have better solution, please do share your VI too.

 


Try the attached. Arguably simpler!

 

Listboxer.png

 

 

0 Kudos
Message 18 of 23
(2,068 Views)

Thank for your solution, however it didn't suit the application.

As "multiple selection without using ctrl key" as mentioned in title,

In application like touch screen where ctrl or shift cannot be press.

 

1) I didn't notice there is "0 or more item" selection mode. Good to know that. However for "mouse up" method, it seems like no differences.

2) "Value change" method still unable deselect the last value by clicking it. Unless it using ctrl key. It's quite annoying.

3) Sorry for the annoying fp. Usually I use dual monitor for coding, I will take note next time. Btw, it could change to any size for depends on own preference.

4) Stop button is just depends on own preference only. for testing vi, I just stop it by using ctrl + "." 

 

Anyway, thanks for the solution.

0 Kudos
Message 19 of 23
(2,056 Views)

Another option I sometimes use is to keep e.g. a boolean array in a shift registers and whenever an entry is double-clicked I switch the symbol from blank to a checkmark or back and update the boolean array accordingly. Now the listbox must be set to "1 item" and I even color the selection white so it is invisible. The information on the selected items is in the boolean array and indicated with the symbol.

0 Kudos
Message 20 of 23
(2,039 Views)