Solved

Visual Studio 2008 Drag and drop

Posted on 2008-10-18
2
940 Views
Last Modified: 2013-11-26
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
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
omegaomega earned 500 total points
ID: 22749963
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
 

Author Closing Comment

by:Murray Brown
ID: 31507425
thanks very much! Great answer
0

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question