LISTVIEW MUDANDO DE CORES

HELIO.COSTA 02/05/2012 21:28:05
#401222
Boa noite!

Tenho um listview com o seguinte comando.

Private Sub ListView1_ItemCheck(ByVal ITEM As MSComctlLib.ListItem)
Dim ITEMSel As ListItem
Me.Tag = ITEM.Text
Resp = ITEM.Text
Set ITEMSel = ListView1.FindItem(Resp)
ListView1.FullRowSelect = True
ITEMSel.Selected = True
ITEMSel.EnsureVisible
ITEMSel.Bold = True
ITEMSel.ForeColor = vbBlue
For i = 1 To 6
ITEMSel.ListSubItems(i).Bold = True
ITEMSel.ListSubItems(i).ForeColor = vbBlue
Next i
Set ITEMSel = Nothing
End Sub


Seleciono a linha deixando de negrito e em azul, agora quando desmarco gostaria de voltar a cor normal e sem negrito.
ROBIU 02/05/2012 21:52:36
#401223
Resposta escolhida
Private Sub ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)
Dim ITEMSel As ListItem
Me.Tag = Item.Text
Resp = Item.Text
Set ITEMSel = ListView1.FindItem(Resp)
ListView1.FullRowSelect = True
ITEMSel.Selected = True
ITEMSel.EnsureVisible
ITEMSel.Bold = True
ITEMSel.ForeColor = vbBlue
For i = 1 To 6
If Item.Checked = True Then
ITEMSel.ListSubItems(i).Bold = True
ITEMSel.ListSubItems(i).ForeColor = vbBlue
Else
ITEMSel.ListSubItems(i).Bold = False
ITEMSel.ListSubItems(i).ForeColor = vbBlack
End If
Next i
Set ITEMSel = Nothing
End Sub
HELIO.COSTA 02/05/2012 22:20:47
#401224
Com uma mudança deu certo, postando mudança:

Private Sub ListView1_ItemCheck(ByVal ITEM As MSComctlLib.ListItem)
Dim ITEMSel As ListItem
Me.Tag = ITEM.Text
Resp = ITEM.Text
Set ITEMSel = ListView1.FindItem(Resp)
ListView1.FullRowSelect = True
ITEMSel.Selected = True
ITEMSel.EnsureVisible
For i = 1 To 6
If ITEM.Checked = True Then
ITEMSel.Bold = True
ITEMSel.ForeColor = vbBlue
ITEMSel.ListSubItems(i).Bold = True
ITEMSel.ListSubItems(i).ForeColor = vbBlue
Else
ITEMSel.Bold = False
ITEMSel.ForeColor = vbBlack
ITEMSel.ListSubItems(i).Bold = False
ITEMSel.ListSubItems(i).ForeColor = vbBlack
End If
Next i
Set ITEMSel = Nothing
End Sub

Muito obrigodo,

Tópico encerrado , respostas não são mais permitidas