Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Visual Studio 2008 Drag and drop

Posted on 2008-10-18
2
Medium Priority
?
943 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 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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