Click to See Complete Forum and Search --> : [RESOLVED] Start Date MonthCalendar


Rigsby
January 20th, 2008, 03:20 PM
I really am a newbie, so please go easy on me!

With help from the Code Guru forums, I have actually managed to get a MonthCalendar doing what I want, except for one thing:

The MonthCalendar pops up at today’s date! How can I get it to start at a different date? I have searched the web and can find no answer that I understand. It seems I need to use:

MonthCal_SetCurSel(hWndMonthCal, ???????????);

But I don’t know how to send the value to the second parameter (????????????). What I have is a:

TCHAR date[50];

So effectively need:

MonthCal_SetCurSel(hWndMonthCal, date);

Which obviously, will not work!

This should be the start date of the MonthCalendar! How do I do that? This variable "date" holds a string in the format: DD.MM.YYYY, so, for example: 15.11.1950

Thanks

sjaycohn
January 20th, 2008, 08:05 PM
I have no idea what you're talking about.
Why don't you post your code?
Perhaps your whole project zipped up, and I'd be happy to look at it for you.

Rigsby
January 24th, 2008, 04:55 PM
I have no idea what you're talking about.
Why don't you post your code?
Perhaps your whole project zipped up, and I'd be happy to look at it for you.

Then you’re apparently not able to help me:

A MonthCalendar is a control that we can add to a form

This control shows a calendar, which the user can click to select a date

When the MonthCalendar is first initialized (Starts and shows), it automatically marks the computer date on the day the program is run (puts a color behind today’s date) .

I simply needed the thing to mark a different date. I’m sorry if my English was so bad that you couldn’t understand it!

Anyway, I’ve solved the issue with:


MonthCal_SetCurSel(hWndMonthCal, &datein);