Solved

Drag & Drop between Listviews

Posted on 2000-03-06
2
377 Views
Last Modified: 2009-07-23
I want to be able to drag and drop between two list boxesHow do I do this?
0
Comment
Question by:visualbasic
2 Comments
 
LVL 1

Accepted Solution

by:
Catouch earned 50 total points
ID: 2587105
you can use this to start with


Private Sub list1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = vbLeftButton Then ' Signal a Drag operation.
        Set nodX = list1.HitTest(X, Y)
        If Not nodX Is Nothing Then
            If nodX.Selected Then
                indrag = True
                list1.DragIcon = Img32x32.ListImages("drag").Picture 'list1.SelectedItem.CreateDragImage
                list1.Drag vbBeginDrag ' Drag operation.
            End If
        End If
    End If
End Sub


Private Sub list1_DragDrop(Source As Control, X As Single, Y As Single)
   If Not list1.DropHighlight Is Nothing Then
        If nodX = list1.DropHighlight Then
            Exit Sub
            Debug.Print nodX.Text & " dropped on " & list1.DropHighlight.Text
        End If
   End If
    Set list1.DropHighlight = Nothing
    indrag = False
End Sub

0
 

Author Comment

by:visualbasic
ID: 2587879
Thank a million
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

21 Experts available now in Live!

Get 1:1 Help Now