Page 1 of 1

Calendar does not "throw" any events

Posted: 25 Nov 2011, 14:54
by TickTick
Hello!

I have un-disabled all events (keyboard, mouse, etc.).

Nevertheless I still don't get any events if the user changes the CaretDate.

Did I overlook something?

Thank you.

Re: Calendar does not "throw" any events

Posted: 25 Nov 2011, 19:54
by TiKu
Hi,

you should not need to enable any event in order to get notified when the user clicks a date. The SelectionChanged event should be fired then and this event can't be disabled.
Does the Events sample work for you? It writes a log message whenever an event is fired. If it doesn't work, then please tell me which version of Windows you are using and how you have configured the control.

Regards
TiKu

Re: Calendar does not "throw" any events

Posted: 23 Aug 2012, 16:26
by Alantar
Hmm, I get the same behaviour here. No events get fired, neither for the control itself nor for an Object variable declared WithEvents.

I'm on Windows XP SP3, Access 2007 SP2.

Regards,
Oliver

Re: Calendar does not "throw" any events

Posted: 23 Aug 2012, 21:59
by TiKu
Open the control's property pages and make sure that the events that you want to use are enabled (property DisabledEvents).

Re: Calendar does not "throw" any events

Posted: 24 Aug 2012, 09:52
by Alantar
I did some more tests.

I did try enabling all events. I also tried the ANSI and Unicode versions of the controls. There is no difference.
The Events I want are not listed in the enumerations to disable events anyway. I would like to react to "GetBoldDates" and "SelectionChanged". These Events are not fired.

The "Click" Event, however, is fired correctly when enabled.

Your Events-Sample works as inteded and logs the SelectionChanged-Event after the Click-Event. It seems there is a difference between VB6 and Access2007.

Some more things:
KeyUp and KeyDown work, KeyPress does not. All of them work in the Events-Sample.
I also tried the "MultipleCalenders"-Sample, but it just says "This smaple requires version 6.10 or newer of comctl32.dll". The version i have is 5.82.

I hope that will help to pinpoint the problem.

Regards,
Oliver

Re: Calendar does not "throw" any events

Posted: 24 Aug 2012, 14:49
by TiKu
I have to admit that I do not officially support MS Office, because I do not own a license of it. At my working place I have Office 2010, but of course I cannot work on hobby projects during work.

Re: Calendar does not "throw" any events

Posted: 24 Aug 2012, 21:55
by TiKu
Before leaving work, I did a quick test with Excel 2010 (we don't have Access installed). I placed the Calendar control onto a user form and added a method for the SelectionChanged event. The event was fired correctly and there were no bold dates.
Does it work for you with Excel 2007? If not, please send me an Excel file that demonstrates the sample and I'll check it with Excel 2010.

Re: Calendar does not "throw" any events

Posted: 27 Aug 2012, 08:12
by Alantar
I tried the control with Excel and it works perfectly. So the problem seems to be with Access. I know that Access handles the Forms a little different than Excel. The behaviour of Excel-Forms seems to be a lot closer to VB6 than what Access does. I will see if I can make do with some workarounds as I would really like to get rid of the Calendar in the CommonControls.

Still thanks for your effort! I will try out some more of your controls, too and report my findings.

Re: Calendar does not "throw" any events

Posted: 28 Aug 2012, 06:56
by TiKu
If I had MS Access, I could help you. I'm afraid that without changes to the code there's no way to make it work in Access.