Solved

Drag & Drop between Listviews

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

728 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