Hi
My goal is to make all wednesdays in a month to be bolded and selectable. Whereas, the other dates should be greyed out and the user should not be able to select.
So pls help me how can we implement this in a c#.Net windows calendar control
Hi
My goal is to make all wednesdays in a month to be bolded and selectable. Whereas, the other dates should be greyed out and the user should not be able to select.
So pls help me how can we implement this in a c#.Net windows calendar control
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Scott LyslePosted Dec 31, 2008, 1:08 AM
You can bold the Wednesdays with something like this:
List
<DateTime> weds = new List<DateTime>(); for(int d = 1; d < DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); d++ ){
DateTime thisDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, d); if (thisDay.DayOfWeek == DayOfWeek.Wednesday){
weds.Add(thisDay);
}
if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)weds.Add(
DateTime.Now);monthCalendar1.BoldedDates = weds.ToArray();
}