Results 1 to 4 of 4

Thread: Drag drop with listviews

  1. #1

    Thread Starter
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724

    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.....

  2. #2

    Thread Starter
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724
    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...

  3. #3

    Thread Starter
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724
    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....

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Will this help ?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width