MonthCalendar help.

I am realy lost here.

I am trying to create an MonthCalendar, with an If() sentence.

E.g. When date 30/12-2006 is picked, then, lets say, textBox1 should say "Fish".

But i just can not figure it out.

I have tryed everything, and searched all develop pages i know.

Help pleace.




Answer this question

MonthCalendar help.

  • jewelfire

    I can try to explain what i am trying to do.

    I need to be able to put in events by updating the program. So that, when clicked on the Bolded date, text about the event shows, in different textboxes etc.

    But i just cant get it working.

    I figure it has something to do with the DateTime(Year, Month, Day)

    But to tricker that, how

    I have tryed the DateSelected Event, but i could not get it working.

    Pleace have patience with me :-)

    (By the way, i am from Denmark, so if there are spelling errors, that is the reason ;-))



  • FastCoder28

    Not really, sorry, but i am pretty new at this.

    Is it posible to get a little more help



  • Chidu

    absolutely you can ask for help :-) but what are you having problems with

    I understand you want to display some text for example when a certain date is picked correct

    Well, for the Month calander, you need to implement the DateSelected Event. When a date has been selected by the user, this event will fire automatically.

    In this event, you simply check the start date, or end date, and check if it is the date you are wanting and if so, then set the text to the textbox for example.

    The link supplied shows you more about implementing and using the event.



  • Roxy1980

    you look at the value chosen and compare it to the date you like.

    Now, there is an event called "DateSelected" which you can implement, this event fires when the user changes the date via the mouse. You can then look at the date they chose from the parameter in this event (the DateRangeEventArgs) and do your comparison. The DateRangeEventArgs gives you the start and end dateTime values the user has chosen:

    http://msdn2.microsoft.com/en-us/library/system.windows.forms.monthcalendar.aspx

    Does this help



  • MonthCalendar help.