drag from listview to treeview

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

drag from listview to treeview

Post by sal21 »

I'm not sure...

Possible to drag IMPARATO SALVATORE (entire row from listview) and insert over the the item (in rectangle) of treeview?

Impossible based my knoledgement :grin:
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: drag from listview to treeview

Post by HansV »

Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

Re: drag from listview to treeview

Post by sal21 »

GREAT progress i think...

Code: Select all

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

    If Button = vbLeftButton Then
    
    With Me.ListView1
        Set .SelectedItem = .HitTest(X, Y)
        .DragIcon = LoadPicture("C:\Lavori_Vb6\HOTEL\IMG\" & "DRAGMOVE.CUR")
        .Drag vbBeginDrag
    End With
        End If

End Sub
but this code cut for drag only the first value in row! in my case 0015, if i click on the first row!!!

i need to drag entire row set, for dragging, similar:

...
Set ITMX = .HitTest(X, Y)
ITMX .ListSubItems(1).Text & "-" & ITMX .ListSubItems(2).Text & "-" & ITMX .ListSubItems(3).Text & "-" & ITMX .ListSubItems(4).Text
....
i hope understand me
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: drag from listview to treeview

Post by HansV »

Do you want to add a node to the treeview when dropped?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

Re: drag from listview to treeview

Post by sal21 »

HansV wrote:
23 Jul 2021, 15:58
Do you want to add a node to the treeview when dropped?
yes from listview1to treview1....

i just post a total image in old post

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: drag from listview to treeview

Post by HansV »

Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

Re: drag from listview to treeview

Post by sal21 »

HansV wrote:
23 Jul 2021, 16:46
See TreeView Drag And Drop
nice!