Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 950
  • Last Modified:

Visual Studio 2008 Drag and drop

Hi

I am building an appin Visual Studio 2008, where the user sees colored shapes with text on and drags them into a listview control. When this happens a new line of data will be added.

How would I do this in Visual Basic?

Thanks
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
omegaomegaDeveloperCommented:
Hello, murbro,


If the coloured shapes are rendered as controls on a form then:
    - Record the mouse start position in the control's OnMouseDown method.  
    - Clear the start position record in the OnMouseUp method.
    - In the OnMouseMove method (if the start position is recorded) call the DoDragDrop method.
    - Handle the appropriate DragEnter, DragOver, and DragLeave events in the form and ListView control to animate the movement of the coloured control.
    - Handle the DragDrop event from the ListView control to provide the desired processing when the coloured control is finally dropped.

That's it, very briefly.  I hope it gives you enough to get started.

Cheers,
Randy
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks very much! Great answer
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now