|
-
Jan 1st, 2006, 05:45 PM
#1
Thread Starter
Lively Member
[RESOLVED] drag and drop order question
Code:
Dim f() As String
' Assign the files to an array.
f = e.Data.GetData(DataFormats.FileDrop)
I use the above code in my DragDrop event to get a list of files which were drag and dropped onto my form. My only problem is the order of the files. If I selected a bunch of files in explorer and drag them onto my form they are put into the f() array in a different order then they were selected and dragged.
Any suggestions?
-
Jan 1st, 2006, 06:04 PM
#2
Thread Starter
Lively Member
Re: drag and drop order question
if I select these files:
1.jpg
2.jpg
3.jpg
4.jpg
5.jpg
6.jpg
and set a breakpoint after the last line of code and watch f() it's arranged like this after the drag and drop operation.
(0) 3.jpg
(1) 4.jpg
(2) 5.jpg
(3) 6.jpg
(4) 1.jpg
(5) 2.jpg
Now is that explorer passing them in that order or is GetData sorting them somehow?
-
Jan 1st, 2006, 06:21 PM
#3
Re: drag and drop order question
If you selected them in the order posted then it may be that in explorer its order is different since you can have 5 different view and 4 different sorting methods. in other words, what you see is not necissarily the actual index order.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 2nd, 2006, 12:43 AM
#4
Thread Starter
Lively Member
Re: drag and drop order question
yeah that must be it.. I just re-sorted in my app.. solved the issue
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|