annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

multiple selection in listbox without using ctrl key

Risolto!
Vai alla soluzione
Just Kidding
0 Kudos
Messaggio 11 di 23
4.224Visualizzazioni

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
Messaggio 12 di 23
3.425Visualizzazioni

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
Messaggio 13 di 23
3.416Visualizzazioni

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
Messaggio 14 di 23
3.412Visualizzazioni

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
Messaggio 15 di 23
3.405Visualizzazioni

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
Messaggio 16 di 23
3.408Visualizzazioni

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
Messaggio 17 di 23
3.401Visualizzazioni

@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
Messaggio 18 di 23
3.390Visualizzazioni

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
Messaggio 19 di 23
3.378Visualizzazioni

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
Messaggio 20 di 23
3.361Visualizzazioni