Dim ids As String
Dim n As Integer = 6 '未来天数,含今天,所以实际是未来7天
Dim dt As Date = dr("出生日期")
Dim dt1 As New Date(Date.Today.Year,dt.Month,dt.Day)
Dim dt2 As New Date(Date.Today.AddDays(n).Year,dt.Month,dt.Day)If e.col.Name = "出生日期" Then
If e.Row.IsNull("出生日期") = False
If (dt1 >= Date.Today AndAlso dt1 < Date.Today.AddDays(n)) OrElse (dt2 >= Date.Today AndAlso dt2 < Date.Today.AddDays(n)) Then
e.Style = "生日提醒"
End If
End If
End If
以上语句是否正确?我是想在6天内的生日在“出生日期”那列有颜色显示。