Solved

Visual Studio 2008 Drag and drop

Posted on 2008-10-18
2
918 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
Comment Utility
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
Comment Utility
thanks very much! Great answer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now