Solved

Visual Studio 2008 Drag and drop

Posted on 2008-10-18
2
928 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:murbro
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:murbro
ID: 31507425
thanks very much! Great answer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run time Error 4 48
Connection String 16 61
.net and XML report from SCCM 5 25
SQL Help 27 46
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

821 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