Solved

Drag & Drop between Listviews

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 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…

726 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