Skip to main content

AccessTr.neT


Mscomctllib.listviewctrl.2 İtem Backcolor

Mscomctllib.listviewctrl.2 İtem Backcolor

#3

Public Sub ColorListviewRow(lv As ListView, RowNbr As Long, RowColor As OLE_COLOR)
'***************************************************************************
'Purpose: Color a ListView Row
'Inputs : lv - The ListView
'        RowNbr - The index of the row to be colored
'        RowColor - The color to color it
'Outputs: None
'***************************************************************************
    Dim itmX As ListItem
    Dim lvSI As ListSubItem
    Dim intIndex As Integer
    On Error GoTo ErrorRoutine
    Set itmX = lv.ListItems(RowNbr)
    itmX.ForeColor = RowColor
    For intIndex = 1 To lv.ColumnHeaders.Count - 1
        Set lvSI = itmX.ListSubItems(intIndex)

        lvSI.ForeColor = RowColor
    Next

    Set itmX = Nothing
    Set lvSI = Nothing
   
    Exit Sub

ErrorRoutine:

    MsgBox Err.Description

End Sub


Usage: (To make the 5th row of a ListView Red)
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Mscomctllib.listviewctrl.2 İtem Backcolor - Yazar: accessman - 06/02/2020, 07:24
Task