|  | 
| Implementing custom event handlers in .NET | 
| Post Reply   | 
| Author | |
| zotteLORRE   Newbie   Joined: 31 August 2006 Location: Belgium Status: Offline Points: 5 |  Post Options  Thanks(0)  Quote  Reply  Topic: Implementing custom event handlers in .NET Posted: 31 August 2006 at 5:42am | 
| 
   
Hi, I'm busy evaluating the CalendarPro Active-X in a VB.NET dev enviroment for our company, and have encountered some problems implementing custom event handlers for a MySQL data source. Implementing doRetrieveDayEvents & doCreateEvent, for example, works fine, but doUpdateEvent doesn't get fired at all. I've implemented following code directly in the frmMain class: Private Sub CalendarControl_doRetrieveDayEvents(ByVal sender As System.Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoRetrieveDayEventsEvent) Handles CalendarControl.DoRetrieveDayEvents dbController.doQuerySelectEvents(e.dtDay, e.events, CalendarControl.DataProvider, nUserID) End Sub Private Sub CalendarControl_doCreateEvent(ByVal sender As System.Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoCreateEventEvent) Handles CalendarControl.DoCreateEvent dbController.doQueryInsertEvent(e.newEventID, e.pEvent, CalendarControl.DataProvider, nUserID, e.bResult) End Sub Private Sub CalendarControl_doUpdateEvent(ByVal sender As System.Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoUpdateEventEvent) Handles CalendarControl.DoUpdateEvent MessageBox.Show("test doupdateevent") 'temp 'dbController.doQueryUpdateEvent(e.pEvent, CalendarControl.DataProvider, nUserID, e.bResult) End Sub Am I wrong putting above code directly in the main form? Thanks in advance, Laurent | |
|  | |
| sserge   Moderator Group   Joined: 01 December 2004 Status: Offline Points: 1297 |  Post Options  Thanks(0)  Quote  Reply  Posted: 01 September 2006 at 6:55am | 
| 
   Hi Laurent, 
This is strange. I have just tested this -- added 3 empty handlers and all 3 events are coming fine. 
DoUpdateEvent comes when you move/resize/edit existing event in the calendar. 
My code is like the following:
 
Private
Sub
 frmMain1_Load(
ByVal
 sender 
As
 System.Object, 
ByVal
 e 
As
 System.EventArgs) 
Handles
 
MyBase
.Load   
CalendarControl.SetDataProvider("Provider=CUSTOM;")
   
CalendarControl.DataProvider.Open()
 
' Ensure that you call Open!
 
End
 
Sub   
ByVal
 e 
As
 AxXtremeCalendarControl._DCalendarControlEvents_DoCreateEventEvent) 
   
Handles
 CalendarControl.DoCreateEvent
 
End
 
Sub 
Private
 
Sub
 CalendarControl_DoRetrieveDayEvents(
ByVal
 sender 
As
 
Object
, 
   
               
ByVal
 e 
As
 AxXtremeCalendarControl._DCalendarControlEvents_DoRetrieveDayEventsEvent) 
   
Handles
 CalendarControl.DoRetrieveDayEvents
 
End
 
Sub 
Private
 
Sub
 CalendarControl_DoUpdateEvent(
ByVal
 sender 
As
 
Object
, 
   
                
ByVal
 e 
As
 AxXtremeCalendarControl._DCalendarControlEvents_DoUpdateEventEvent) 
   
Handles
 CalendarControl.DoUpdateEvent
 
End
 
Sub
 -- WBR, Serge | |
|  | |
| zotteLORRE   Newbie   Joined: 31 August 2006 Location: Belgium Status: Offline Points: 5 |  Post Options  Thanks(0)  Quote  Reply  Posted: 15 September 2006 at 8:08am | 
| 
   
Serge, Strange indeed, but I guess the problem was somewhere (?) in my code. After lots of debugging, I decided to start from scratch and use the VB6 sample as an example (and read the documentation...). A little bit embarassing, since I didn't manage to find the bug...  Anyway, everything works fine now! Thanks for your time, Laurent | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |