none
Calendar Control

    Question

  • Hi,
    I am using Visual Studio.net 2008 C#
    I have a program in which i need to do some bookings. What i need is a visual calendar on which i can show the booked and available days. I have found the Calendar Control 12.0 which has a very beautiful look for my purpose. but i dont know how to indicate the availability of the days on the calendar. I would like to have the booked day to be shown different than usual days like may be different color or be sunken . but i dont know how to do that.
    If there is no way to do so in Calendar Control then please tell me which control should i use for that and how.

    Thanks alot.
    Wednesday, July 30, 2008 6:04 PM

Answers

  • I faced a similar problem about two eeks ago. I tried to make do with MonthlyCalendar and Calendar classes. None of them worked to my satisfaction. Such controls are very rigid by necessity. MS cannot tailor them to whimiscal desires of individuals.

    After I learned the lesson, which I pretty much have known for years, I designed my own calendar which is now in use. I've decided not to share the code, sorry about it, but I can tell you how it went. It is rather simple, took me about two days although I kept adding additional features and still do.

    It is a custom control that inherits form Panel. I clicked on Vista taskbar and observed how the calendar down there is built. I then designed two custom classes: myButton and myLabel. Then I put 7 x 6 matrix of myButton(s) and on top of that a row of myLabel(s). They say: "Su" "Mo," etc. You know what I mean. I defined the back and fore colors I wanted. When I change months (with yet another button) the display works exactly like the Vista's calendar. That required of course some tweaking. You have to calculate how those days will be layered every month on the display. I am used to it. I can almost do it in my sleep.

    In the end I have this beautiful calendar, a dataGridView with my diary entries is positioned next to it. If I hover a mouse over the days the corresponding buttons are flashing if there is something important. I am sure I will be adding some new and interesting features to it for a few weeks now. 
    AlexB
    Thursday, July 31, 2008 12:10 AM
  • The Windows Forms MonthCalendar control gives you the BoldedDates property to indicate special dates.  No option to use colors.

    The "Calendar Control 12.0" control is an ActiveX control, it is not supported in these forums.  I don't see anything it is properties and methods that resembles a way to highlight/color preferred dates.  Nor is it at all clear how you would get that control installed on another machine.  It looks to me like the customer would have to install Office 2007.  You are definitely not allowed to distribute this control yourself.
    Hans Passant.
    Thursday, July 31, 2008 12:03 AM

All replies

  • Hey....

    In this you have two more controls...

    DateTimePicker
    &
    MonthCalendar

    In which they have many properties like
    calenderforeColor
    CalenderMonthBackGroub

    &

    Various Color Schemes are there


    Try this..


    Regards


    TusharCapoor
    Wednesday, July 30, 2008 7:17 PM
  • I dont know which version do you use, but none of the controls that you mentioned have any of the properties that you wrote. Secondly they dont solve my problem at all.
    I want to be able to write on a particular day or make the appearace of that particular day on calendar to be different as the data in database changes.

    thanks for your reply but didnt work.
    Wednesday, July 30, 2008 11:35 PM
  • The Windows Forms MonthCalendar control gives you the BoldedDates property to indicate special dates.  No option to use colors.

    The "Calendar Control 12.0" control is an ActiveX control, it is not supported in these forums.  I don't see anything it is properties and methods that resembles a way to highlight/color preferred dates.  Nor is it at all clear how you would get that control installed on another machine.  It looks to me like the customer would have to install Office 2007.  You are definitely not allowed to distribute this control yourself.
    Hans Passant.
    Thursday, July 31, 2008 12:03 AM
  • I faced a similar problem about two eeks ago. I tried to make do with MonthlyCalendar and Calendar classes. None of them worked to my satisfaction. Such controls are very rigid by necessity. MS cannot tailor them to whimiscal desires of individuals.

    After I learned the lesson, which I pretty much have known for years, I designed my own calendar which is now in use. I've decided not to share the code, sorry about it, but I can tell you how it went. It is rather simple, took me about two days although I kept adding additional features and still do.

    It is a custom control that inherits form Panel. I clicked on Vista taskbar and observed how the calendar down there is built. I then designed two custom classes: myButton and myLabel. Then I put 7 x 6 matrix of myButton(s) and on top of that a row of myLabel(s). They say: "Su" "Mo," etc. You know what I mean. I defined the back and fore colors I wanted. When I change months (with yet another button) the display works exactly like the Vista's calendar. That required of course some tweaking. You have to calculate how those days will be layered every month on the display. I am used to it. I can almost do it in my sleep.

    In the end I have this beautiful calendar, a dataGridView with my diary entries is positioned next to it. If I hover a mouse over the days the corresponding buttons are flashing if there is something important. I am sure I will be adding some new and interesting features to it for a few weeks now. 
    AlexB
    Thursday, July 31, 2008 12:10 AM
  • HI,

    I have done like that

    if (rsSchedule != null)
                {
                    for (int i = 0; i < rsSchedule.Tables[0].Rows.Count; i++)
                    {
                        String seldates = rsSchedule.Tables[0].Rows[i]["ScheduleDate"].ToString();
                        calSchedule.SelectedDates.Add(Convert.ToDateTime(seldates));
                    }
                    if (calSchedule.SelectedDates.Count == 1)
                        calSchedule.SelectedDates.Add(System.DateTime.MinValue);
                }

    rsSchedule is the recordset of date values which I want to show as selected.


    Regards
    /Devdas
    Monday, August 25, 2008 12:41 PM