在DesignTime属性页的DropDownCalendar->DateStyls->Holiday里可以很方便地定制,或者用以下的代码添加:
Holiday h = new Holiday(10,1,10,3);
HolidayStyle hs = new HolidayStyle("MyHoliday");
hs.SubStyle.BackColor = Color.Yellow;
hs.SubStyle.ForeColor = Color.Red;
hs.Holidays.Add(h);
this.GcDate1.DropDownCalendar.HolidayStyles.Add("MyHoliday", hs);
this.GcDate1.DropDownCalendar.ActiveHolidayStyles = new string[]{"MyHoliday"}; |