I have created a listview and I putted image on each listViewItem.
I see that there is the place for the image on each row when the program run (blank space) but I don't see the image. Why? Is there a problem with the format of the image (Bmp)?
My code: (lst_Report is the listView and images come from an imageList).
Me.lst_Report.Items.Clear()
liste = Me.refreshListe
For Each r In liste.Rows
item = New ListViewItem(CType(r.Item ("FILENUMBER"), String) & "/" & CType(r.Item("SEQUENTIEL"), Integer).ToString("000"))
item.SubItems.Add(CType(r.Item("PRONOUNCEMENTDATE"), Date).ToString("dd\/MM\/yyy"))
If (r.IsNull("DATE_GEN") = False) Then
item.SubItems.Add(CType(r.Item("DATE_GEN"), Date).ToString("dd\/MM\/yyy"))
Else
item.SubItems.Add("")
End If
Me.lst_Report.Items.Add(item)
If (r.IsNull("DATE_GEN") = True) Then
item.ImageIndex = 1
Else
item.ImageIndex = 0
End If
Next
Me.lst_Report.Update()
I see that there is the place for the image on each row when the program run (blank space) but I don't see the image. Why? Is there a problem with the format of the image (Bmp)?
My code: (lst_Report is the listView and images come from an imageList).
Me.lst_Report.Items.Clear()
liste = Me.refreshListe
For Each r In liste.Rows
item = New ListViewItem(CType(r.Item ("FILENUMBER"), String) & "/" & CType(r.Item("SEQUENTIEL"), Integer).ToString("000"))
item.SubItems.Add(CType(r.Item("PRONOUNCEMENTDATE"), Date).ToString("dd\/MM\/yyy"))
If (r.IsNull("DATE_GEN") = False) Then
item.SubItems.Add(CType(r.Item("DATE_GEN"), Date).ToString("dd\/MM\/yyy"))
Else
item.SubItems.Add("")
End If
Me.lst_Report.Items.Add(item)
If (r.IsNull("DATE_GEN") = True) Then
item.ImageIndex = 1
Else
item.ImageIndex = 0
End If
Next
Me.lst_Report.Update()