Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Colour In Month View (Read 2306 times)
danielbr
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Mar 21st, 2006
Colour In Month View
Jul 30th, 2007 at 2:32pm
Print Post  
My application only loads appointments for a specific period of time, say a week. I'd like to show in the month view days loaded as a different colour. When the user clicks on a normal coloured day the system loads the data for that time region (+- x days worth of appointments) and the month view will update with a different colour to show that.

What's the best way of changing the colour of a day in the month view?

Thanks,

Daniel
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Colour In Month View
Reply #1 - Jul 31st, 2007 at 4:46am
Print Post  
You can do that by creating a DateStyle object and add it to the Calendar.DayStyles collection. This way you will apply custom formatting to a date range. The following code illustrates how you can change the background color to green of 31th of July:

Code
Select All
DateStyle s = new DateStyle();
s.From = new DateTime(2007, 7, 31);
s.To = new DateTime(2007, 7, 31);
s.Style.Brush = new MindFusion.Drawing.SolidBrush(Color.Green);
calendar1.DayStyles.Add(s); 


You can also use custom drawing for the same purpose by handling the Calendar.Draw event.

Meppy
  
Back to top
 
IP Logged
 
danielbr
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Mar 21st, 2006
Re: Colour In Month View
Reply #2 - Jul 31st, 2007 at 6:11am
Print Post  
Excellent works like a charm.

Thanks,

Daniel
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint