06-09-20, 11:45 PM
الحل بسيط واستخدمه دايما
ضعي كود التلوين في الحدث CellFormatting للداتاجريد
ضعي كود التلوين في الحدث CellFormatting للداتاجريد
PHP كود :
Private Sub DataGridView1_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
If e.ColumnIndex = 1 And e.Value IsNot Nothing Then
Dim a As Date = Date.Today
If CDate(e.Value) <= a Then
sender.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.Orange
End If
Dim b As Date = Date.Today.Date.AddDays(31)
If CDate(e.Value) > a And CDate(e.Value) <= b Then
sender.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.Green
End If
End If
End Sub
