codice:
Dim I As Integer
Dim itm As ListItem
Dim Qmin As Double
Dim Qua As Double
Dim objF As New CParti
Dim rsF As ADODB.Recordset
LvM.ListItems.Clear
If rsF.RecordCount > 0 Then
For I = 0 To rsF.RecordCount - 1
If Not rsF("Quantita").Value = "" Then Qua = rsF("Quantita").Value Else Qua = 0
If Not rsF("QuantitaMinima").Value = "" Then Qmin = rsF("QuantitaMinima").Value Else Qmin = 0
Set itm = LvM.ListItems.Add(, "a" & CStr(KeyM))
If Qua < Qmin Then itm.ListSubItems(1).ForeColor = vbRed Else itm.ListSubItems(1).ForeColor = vbBlack
itm.Text = rsF("ID").Value
If Not IsNull(rsF("Quantita").Value) Then itm.SubItems(2) = rsF("Quantita").Value Else itm.SubItems(2) = "0"
Select Case Language
Case "ITA"
If Not IsNull(rsF("NomeIta").Value) Then itm.SubItems(1) = rsF("NomeIta").Value Else itm.SubItems(1) = "NO NAME"
Case "ENG"
If Not IsNull(rsF("NomeEng").Value) Then itm.SubItems(1) = rsF("NomeEng").Value Else itm.SubItems(1) = "NO NAME"
Case "CIN"
If Not IsNull(rsF("NomeCin").Value) Then itm.SubItems(1) = rsF("NomeCin").Value Else itm.SubItems(1) = "NO NAME"
End Select
KeyM = KeyM + 1
lblParti.Caption = KeyM
rsF.MoveNext
Next I
Else
lblParti.Caption = "0"
End If
praticamente fa come se non gli avessi dato l'indicazione di colorare.