Drag and Drop from ...
-
I am trying to do a drag and drop from Windows Explorer to a listview box. I have tried a lot of stuff on MSDN and nothing seems to work. I am using VS 2008 Pro, OS is Vista and everything is up to date. Can someone Please point me in the right direction to something that does work. THNX in advance for the help.
rspercy If "You wash your feet and find a pair of socks " Then "You ARE a Redneck" End If
-
I am trying to do a drag and drop from Windows Explorer to a listview box. I have tried a lot of stuff on MSDN and nothing seems to work. I am using VS 2008 Pro, OS is Vista and everything is up to date. Can someone Please point me in the right direction to something that does work. THNX in advance for the help.
rspercy If "You wash your feet and find a pair of socks " Then "You ARE a Redneck" End If
To receive data is actually pretty easy... 1) Set your listview's "AllowDrop" property to true, to let it receive data 2) In the DragEnter event... In there, you want to check the data being dragged to make sure it's what you want, and if so, set the AllowedEffects property of the DragEventArgs it gives you. This is to let windows know whether to allow the drop to occur. 3) In the DragDrop event... Read the data supplied in the DragEventArgs, and process it. The actual data being passed will be in a few different formats, so set a breakpoint and take a look at the formats to see how you want to receive it. Reference for WinForms: http://msdn.microsoft.com/en-us/library/za0zx9y0.aspx[^] (WPF is pretty much the same, if I remember right)
Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)