Results 1 to 3 of 3

Thread: listview small images display???

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2004
    Location
    Texas
    Posts
    32

    listview small images display???

    I can't seem to make my images display.

    Here is my code.
    *****************************************************
    Dim fDir As System.IO.DirectoryInfo = New System.IO.DirectoryInfo("\\dns1\Faxes$\")
    Dim File As System.IO.FileInfo
    Dim lItems As ListViewItem
    Dim smallImages As New ImageList
    smallImages.Images.Add(Bitmap.FromFile("c:\sheet.ico"))
    Me.ListView1.SmallImageList = smallImages
    Try
    If (fDir.Exists = False) Then
    Console.WriteLine("File path is not valid. Please specify a valid path.")
    Else
    For Each File In fDir.GetFiles()
    lItems = Me.ListView1.Items.Add(Fax.Name)
    lItems.SubItems.Add(File.CreationTime)
    lItems.SubItems.Add(File.LastAccessTime)
    lItems.SubItems.Add((File.Length / 1000) & " KB")
    Next
    End If
    Catch ex As Exception
    Console.WriteLine("The process failed.", ex.ToString)
    End Try

    Can someone please tell me what I'm doing wrong?
    Thanks!!

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    VB Code:
    1. litems.imageindex=0

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2004
    Location
    Texas
    Posts
    32
    That worked great thanks for the 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