27-09-12, 10:30 PM
PHP كود :
انظر الى هذا الكود
Private Sub DataGridView1_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
'العمود الذى يحتوى على التاريخ
If e.ColumnIndex = 0 Then
Dim d As Date
If Not (Me.DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value) Is Nothing Then
d = CDate(Me.DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value)
If d <= Now.AddDays(60) Then
Me.DataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.Yellow
ElseIf d > Now.AddDays(60) Then
Me.DataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.Violet
End If
End If
End If
End Sub

