Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > list files in listview box


Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2002, 05:29 PM
Mantiza
Guest
 
Posts: n/a
Default list files in listview box


I'm trying to list the files from a dir in a listview box. I need two columns ("original file name" and "new file name"). the code i have is:

Private Sub file1_click()

For s = 0 To File1.ListCount - 1
ListBoxOldName = File1.Path & "\" & File1.List(s)
ListBoxNewName = Dir1.Path & "\" & Format$(FileDateTime(ListBoxOldName), "yyyy" + "-" + "MM" + "-" + "dd" + " " + "hh" + " " + "mm" + " " + "ss") & ".jpg" 'error 53

ListView1.ListBoxOldName.Add , , Adodc1.Recordset.Fields("OldName").Value
ListView1.ListBoxNewName.Add , , Adodc1.Recordset.Fields("NewName").Value

Next s

End Sub

...When i run the program i get the error "method or data member not found" I am not sure what i am doing wrong. Do I have to set the viewlistbox to multicolumn in the properties?
Reply With Quote
  #2  
Old 07-31-2002, 06:40 PM
d_hadzima
Guest
 
Posts: n/a
Default

You will get that error becuase the ListView control does not have a method called ListBoxNewName or ListBoxOldName.

If you want two columns you need to go into the properties of the Listview control and insert a column.

You can then use the following two lines to add to the listview where is an index and temp is a unique key.

Good luck with it

Code:
 Call lstvwNotes.ListItems.ADD(i, temp, ListBoxNewName)
        lstvwNotes.ListItems(i).SubItems(1) = ListBoxOldName
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->