Results 1 to 3 of 3

Thread: Listview problem

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Listview problem

    I am merging from being a good asp.net programmer to a good vb.net programmer... and it is going quite slowly, mainly because the win32 form components don't behave like I want them to Here is my problem. Im using this code:

    VB Code:
    1. Dim di As New DirectoryInfo("C:\temp")
    2.  
    3.         ListView1.BeginUpdate()
    4.         ListView1.Items.Clear()
    5.  
    6.         Dim fi As FileInfo
    7.         For Each fi In di.GetFiles
    8.             Dim item As New ListViewItem(fi.Name)
    9.             ListView1.Items.Add(item)
    10.             item.SubItems.Add(fi.Length)
    11.             item.SubItems.Add(fi.CreationTime)
    12.             item.SubItems.Add(fi.LastWriteTime)
    13.  
    14.         Next
    15.  
    16.         ListView1.EndUpdate()

    this is straight from Balenas book on vb.net. this should fill a listview with rows, each row contains info on one file.

    My problem is... if I select the "view" style, I only get the first column and a checkbox, all subitems are gone...

    and if I select "details" I get empty rows...

    what's the problem?


    many thanks for your help!

    yours
    Henrik
    Last edited by MrNorth; Nov 10th, 2003 at 02:43 AM.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    try addig columns to the listview
    umm and which page of his book is that
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    The page is 814-816 of the book "visual basic.net core reference"

    I will try it with columns, but I still have to make listitems and subitems right?


    kind regards
    Henrik

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