annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Detect of drag in VI.

Hi,
How labview can detect if the mouse is dragging a file in VI or not befor to drop it in the path?
Thank you .

0 Compliments
Message 1 sur 5
3 541 Visites

I'm not sure I understand your question completely.  If a file path control has "Allow Dropping" enabled, you should be able to drag a file from anywhere and drop it in the path control and the path to that file will be updated in the control.  If you want to catch the drop before the path to the file is populated, use an event structure and register a Drop event on the control.  You can use this to, for instance, check the file extension and filter out unwanted files.  Do this by wiring a false constant to the Accepted? terminal in the Drop event. 

aputman
0 Compliments
Message 2 sur 5
3 494 Visites

For some reason, this doesn't work as I would expect.  Enabling the option to "Allow Dropping" works and lets me drag a file and update the path, but the Drop filter event is not firing.  I'm still on Labview 2012 so maybe this has changed in newer versions.

aputman
0 Compliments
Message 3 sur 5
3 483 Visites

Just tried in 2015.  Allow Dropping works but the drop filter event did not fire.

Drop Filter.png

Drop Filter Event.png

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Compliments
Message 4 sur 5
3 469 Visites

Turning off dropping doesn't allow you to drag a file into the control, as expected.  So this does seem to be a valid drop action.  Only the Drop event doesn't fire.

 

Seems like a bug to me.  

aputman
0 Compliments
Message 5 sur 5
3 454 Visites