Solved

Drag & Drop between Listviews

Posted on 2000-03-06
2
389 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

789 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