Windows Develop Bookmark and Share   
 index > Windows Forms General > MonthCalendar help.
 

MonthCalendar help.

I am realy lost here.

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

E.g. When date30/12-2006is 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.

Andersen.dc  Tuesday, October 03, 2006 11:40 AM

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?

ahmedilyas  Tuesday, October 03, 2006 12:22 PM

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

Is it posible to get a little more help?

Andersen.dc  Wednesday, October 04, 2006 7:45 AM

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.

ahmedilyas  Wednesday, October 04, 2006 8:08 AM

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 ;-))

Andersen.dc  Wednesday, October 04, 2006 8:18 AM

You can use google to search for other answers

Custom Search

More Threads

• DataGridView.CellContentClick question
• Print Multi-Page Tif File
• checkbox and keyboard shortcuts
• Progress bar in a status bar?
• Textfield with "money" value from DB, shows 4 decimals. How to remove them?
• Controlling Tab appearance
• Color text in cell of datagrid
• Control.EndInvoke Callback
• C#: Can't Get a Form to Scale
• searching control like inbox from outlook 2003