For the example below, the starting listview is lvwDefaultProcess and dropping listview is lvwProcess;
Firstly create two variables in the general declarations area of the form;
Private itmProcess As ListItem
Private blnProcessAdd As Boolean
In the lvwDefaultProcess_OLEStartDrag event add;
blnProcessAdd = True
Set itmProcess = lvwDefaultProcess.SelectedItem
And in the lvwProcess_OLEDragDrop event;
Dim itmNewProcess As ListItem
On Error GoTo Exit_Routine
If Not itmProcess Is Nothing Then
If blnProcessAdd Then
Set itmNewProcess = lvwProcess.ListItems.Add(, itmProcess.Key, itmProcess.Text)
itmNewProcess.SubItems(1) = lvwProcess.ListItems.Count
blnProcessAdd = False
End If
End If
Exit_Routine:
Set itmProcess = Nothing
Set itmNewProcess = Nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.