Perhaps just post icon in listitem

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Perhaps just post icon in listitem

Post by sal21 »

Code: Select all

For I = 0 To UBound(strDBRows, 2)

            ICO = 2
            Set ITMX = .ListItems.Add(, , strDBRows(0, I), ICO)
            ITMX.SmallIcon = ICO
            ITMX.SubItems(1) = strDBRows(1, I)
            ITMX.SubItems(2) = strDBRows(2, I)
            ITMX.SubItems(3) = strDBRows(4, I)
            ITMX.SubItems(4) = strDBRows(6, I)
            ITMX.SubItems(5) = strDBRows(7, I)
            ITMX.SubItems(6) = strDBRows(18, I)
            ITMX.SubItems(7) = Format$(strDBRows(19, I), "HH:MM")
            ITMX.SubItems(8) = strDBRows(23, I)

            If IsNull(strDBRows(24, I)) Then
                ITMX.SubItems(9) = "ATTIVO"
            Else
                ITMX.SubItems(9) = "CANCELLATO"
            End If

        Next I

how to set icon in Imagelist1 with index 4, in ITMX.SubItems(9) = "ATTIVO"

????

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Perhaps just post icon in listitem

Post by HansV »

Code: Select all

ITMX.ListSubItems(9).ReportIcon = 4
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Re: Perhaps just post icon in listitem

Post by sal21 »

HansV wrote:
03 Jun 2020, 10:06

Code: Select all

ITMX.ListSubItems(9).ReportIcon = 4
TKS! :groan: :fanfare:

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Re: Perhaps just post icon in listitem

Post by sal21 »

HansV wrote:
03 Jun 2020, 10:06

Code: Select all

ITMX.ListSubItems(9).ReportIcon = 4

HUMMM.... and to add ico from imagelist1 in first column of listview?

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Perhaps just post icon in listitem

Post by HansV »

Code: Select all

ITMX.Icon = 4
Best wishes,
Hans