Listview help

O

OpticTygre

Are there any good tutorials out on the net that explains the listview
control with great detail? Things like drag-drop features, icon additions,
etc...?
 
O

OpticTygre

BTW, what I'm trying to do is figure out how I can drag items from file
folders or the desktop and have them added to the listview (without actually
copying or removing them from the original spot) and appear in a details
view like manner (with icon). Thanks for any help.
 
O

OpticTygre

Ok, I've gotten a simple solution:



OpticTygre said:
BTW, what I'm trying to do is figure out how I can drag items from file
folders or the desktop and have them added to the listview (without actually
copying or removing them from the original spot) and appear in a details
view like manner (with icon). Thanks for any help.
 
O

OpticTygre

Disreguard last post...hit send too quickly. :blush:)

Ok, I have a simple solution:

Private Sub lstUploads_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles lstUploads.DragDrop
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim FilesToDrop() As String
Dim i As Integer

FilesToDrop = e.Data.GetData(DataFormats.FileDrop)
For i = 0 To FilesToDrop.Length - 1
lstUploads.Items.Add(FilesToDrop(i))
Next
End If
End Sub

Private Sub lstUploads_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles lstUploads.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.All
End If
End Sub

With this, I can drag/drop from anywhere. The problem is, where could I get
the other information involved with those files? IE, Icon properties to add
beside the name, filesize, datemodified, and all that jazzy information?
Does that require a super huge procedure, or could I just do it through
properties of properties of objects, and if so, how? For example, if I
wanted to add the file Test.txt to my listview by dragging it from the
desktop, I don't want just the path. I want a nice pretty txt icon beside
the filename, with size, type, and modified all in a row, just like windows
explorer in detail view mode. Any ideas?

Thanks again
-Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top