If e.Col.Name = "日期" AndAlso e.Row.IsNull("日期") = False Then e.StartDraw() Dim sp As TimeSpan = cdate(e.Row("日期")) - Date.today If sp.TotalDays >= 15 Then e.Graphics.FillRectangle(Brushes.Green,e.x + 1,e.y + 1, e.width, e.Height - 2) ElseIf sp.TotalDays > 0 Then Dim Width As Integer = (e.Width - 2 ) * sp.TotalDays / 15 e.Graphics.FillRectangle(Brushes.Red,e.x + 1,e.y + 1, Width, e.Height - 2) End If e.EndDraw() End If
|