2011-12-18 77 views

回答

0

您可以處理Calendar.DayRender事件並自定義日期範圍內單元格的外觀。一個完整的例子是MSDN文檔頁面上,但最重要的部分是:

Sub DayRender(source As Object, e As DayRenderEventArgs) 
    ' Change the background color of the days in the month to yellow. 
    If Not e.Day.IsOtherMonth And Not e.Day.IsWeekend Then 
     e.Cell.BackColor = System.Drawing.Color.Yellow 
    End If 
End Sub 'DayRender 

你只需要適應If一天來比較您的自定義範圍,改變從黃色的背景顏色爲紅色。