1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| For i = 0 To dgvDeclencheurs.RowCount
'Dates de révisions
If dgvDeclencheurs.Item(4, i).Value > Date.Now.AddMonths(-1) And dgvDeclencheurs(4, i).Value < Date.Now.AddMonths(3) Then
dgvDeclencheurs.Item(4, i).Style.BackColor = Color.Black
dgvDeclencheurs.Rows(i).DefaultCellStyle.ForeColor = Color.Red
ElseIf dgvDeclencheurs.Item(4, i).Value > Date.Now.AddMonths(-3) And dgvDeclencheurs(4, i).Value < Date.Now.AddMonths(3) Then
dgvDeclencheurs.Item(4, i).Style.ForeColor = Color.Orange
dgvDeclencheurs.Rows(i).DefaultCellStyle.ForeColor = Color.Chocolate
End If
'Dates de piles
If dgvDeclencheurs.Item(6, i).Value > Date.Now.AddMonths(+1) And dgvDeclencheurs(6, i).Value < Date.Now.AddMonths(3) Then
dgvDeclencheurs.Item(6, i).Style.BackColor = Color.Black
dgvDeclencheurs.Rows(i).DefaultCellStyle.ForeColor = Color.Red
ElseIf dgvDeclencheurs.Item(6, i).Value > Date.Now.AddMonths(-3) And dgvDeclencheurs(6, i).Value < Date.Now.AddMonths(3) Then
dgvDeclencheurs.Item(6, i).Style.BackColor = Color.Black
dgvDeclencheurs.Rows(i).DefaultCellStyle.ForeColor = Color.Orange
End If
'Nombre de sauts
If dgvDeclencheurs.Item(7, i).Value < dgvDeclencheurs.Item(8, i).Value Then
dgvDeclencheurs.Item(8, i).Style.BackColor = Color.Black
dgvDeclencheurs.Rows(i).DefaultCellStyle.ForeColor = Color.Red
ElseIf dgvDeclencheurs.Item(7, i).Value * (90 / 100) < dgvDeclencheurs.Item(8, i).Value And dgvDeclencheurs.Item(7, i).Value > dgvDeclencheurs.Item(8, i).Value Then
dgvDeclencheurs.Item(8, i).Style.BackColor = Color.Black
dgvDeclencheurs.Rows(i).DefaultCellStyle.ForeColor = Color.Orange
End If
Next |