Torna al Thread
Private Sub DataGridView1_RowPrePaint(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowPrePaintEventArgs) Handles DataGridView1.RowPrePaint
Select Case DataGridView1.Item(5, e.RowIndex).Value
Case Is = "1"
DataGridView1.Rows(e.RowIndex).Cells(5).Style.SelectionBackColor = Color.PowderBlue
DataGridView1.Rows(e.RowIndex).Cells(5).Style.ForeColor = Color.PowderBlue
DataGridView1.Rows(e.RowIndex).Cells(5).Style.BackColor = Color.PowderBlue
Case Is = "2"
DataGridView1.Rows(e.RowIndex).Cells(5).Style.BackColor = Color.YellowGreen
DataGridView1.Rows(e.RowIndex).Cells(5).Style.SelectionBackColor = Color.YellowGreen
DataGridView1.Rows(e.RowIndex).Cells(5).Style.ForeColor = Color.YellowGreen
Case Is = "3"
DataGridView1.Rows(e.RowIndex).Cells(5).Style.BackColor = Color.Orange
DataGridView1.Rows(e.RowIndex).Cells(5).Style.SelectionBackColor = Color.PowderBlue
DataGridView1.Rows(e.RowIndex).Cells(5).Style.ForeColor = Color.PowderBlue
Case Is = "4"
DataGridView1.Rows(e.RowIndex).Cells(5).Style.BackColor = Color.Red
DataGridView1.Rows(e.RowIndex).Cells(5).Style.SelectionBackColor = Color.PowderBlue
DataGridView1.Rows(e.RowIndex).Cells(5).Style.ForeColor = Color.PowderBlue
End Select
End Sub