你到底想怎样显示?
If DrawGannt Then
Dim r As Row = Tables("计划表").Rows(e.Row.Index)
Dim dt1 As Date = r("计划开始日期")
Dim dt2 As Date = r("计划完成日期")
Dim dt3 As Date = r("实际完成日期")
Dim dt As Date = e.Col.Name.Replace("年","-").Replace("月_","-")
If dt>=dt1 AndAlso dt<=dt2 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.Green,e.x ,e.y + 5, e.Width, e.Height - 10)
Else
e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 5, e.Width, e.Height - 10)
End If
e.EndDraw()
End If
If dt>=dt1 AndAlso dt<=dt3 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.Yellow,e.x ,e.y + 5, e.Width, e.Height - 10)
Else
e.Graphics.FillRectangle(Brushes.Blue,e.x ,e.y + 5, e.Width, e.Height - 10)
End If
e.EndDraw()
End If
End If