07-09-20, 12:04 AM
(06-09-20, 11:45 PM)Hasaneen كتب : الحل بسيط واستخدمه دايماشكرا جزيلا لحظرتك تم حل المشكله بنجاح ?
ضعي كود التلوين في الحدث 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
بس اذا ممكن ليش ما عملنا فور لوب هنا اذا ممكن توضيح؟
