-
Drag drop with listviews
hi
i am try out to handle drag drop with listviews....
i have folders and files loaded in listview
when item is drag and drop on other item say file is drop in folder
i need to move the file ...
i tried a bit but seems to have problem
Code:
Private Sub Lvw_Files_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Lvw_Files.DragDrop
Dim lv As ListViewItem
Dim lv_Denst As ListViewItem
Try
lv = CType(e.Data.GetData("System.Windows.Forms.ListViewItem"), ListViewItem)
Dim pt As Point
'pt = Lvw_Files.PointToClient(New Point(e.X, e.Y))
lv_Denst = Lvw_Files.GetItemAt(e.X, e.Y)
If Not (lv_Denst Is Nothing) Then
lv_Denst.Selected = True
MsgBox("source " & lv.Text.ToString & "-- dest " & lv_Denst.Text.ToString)
Else
MsgBox("not found")
End If
Catch ex As Exception
StatusBar1.Panels(0).Text = ex.Message
End Try
lv_Denst = Lvw_Files.GetItemAt(e.X, e.Y) does not return the item.....:confused:
-
welll is it so hard..... is it not possible........
i tried out... but seem some problem
Code:
'in list view drag drop event
lv_Denst = CType(Lvw_Files.GetItemAt(e.X, e.Y), ListViewItem)
does'nt return any value...
:confused:
-
:eek: :( not again....
why is it so ..................
a simple one i belive;) how do i get the ref to the listviewitem when a item is drop on the item
when we do drop in treeview we have
TreeView.GetNodeAt(pt)
do we have one for list view...right we have...
Listview.GetItemAt(e.X, e.Y) but that does not retun any ref....
-