LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The strings I "dragged and dropped" into a listbox cannot be "dragged and dropped" to their original listbox. How can I fix this?

Solved!
Go to solution

I currently have 4 listboxes which are allowed to have their string values dragged and dropped to another 4 listboxes (in any setup: first listbox to fourth, second to third, etc.).  

However, as part of my intentions, I want to be able to take the strings that I initially D&D and return them to their original, respective listbox.  

I attempted the following and it did not work (not to my surprise):

I have a 3-part event case with the following parts: [1] Final listboxes (target) - 1,2,3,4 : Drag Starting?

                                                                         [2] Initial listboxes (source) - 1,2,3,4 : Drag Enter

                                                                         [3] Initial listboxes (source) - 1,2,3,4 : Drop

 

Thanks to whoever responds...much appreciated.

 

Sincerely,

 

IHopeThisIsAValidAlias

0 Kudos
Message 1 of 4
(2,839 Views)

Hello,

 

Please check the KB linked below. It talks about the behavior you are having, doesn't it?

How Do I Keep the Natural Drag and Drop Ability of a Listbox and Handle a Drop Event?

 

Regards

0 Kudos
Message 2 of 4
(2,798 Views)

Unfortunately my issue resides more on getting the initial string back to its original box.   I tried the suggested method and was unsuccessful.  Thank you though.

 

- IHopeThisIsAValidAlias

0 Kudos
Message 3 of 4
(2,752 Views)
Solution

By following the instructions outlined in the article by fromm8 I am not seeing any issues.

 

My feeling is that you are disabling the natural drag & drop behaviour of your listboxes: "handling the drop event[s] overrides the typical ability of a listbox".

Knowing this, your event should re-add the functionality you took away (or stay away from events which you cannot emulate).

 

You mentioned using Drag Starting?, Drag Enter, and Drop but without a much better explaination of how you are using them or example code it is impossible to determine if you really need to use these events or not.

 

My recommendation would be to stay away from these events and, as the article points out, the Drag Ended event works while preserving the D&D of the listboxes.

 

 

0 Kudos
Message 4 of 4
(2,738 Views)