I'm part of group for a college class that is working with a company to create a scheduling system and one of the requirements is to create a custom new appointment form. Could someone give me an idea of how this is done or links to examples? I have looked for awhile now but found nothing useful.
Thanks.
I beleive you need to add a handler for the BeforeDisplayAppointmentDialog event for the CalendarInfo object which gets invoked before the standard dialog appears. you can then disaply your own form and add/update the appointment in the CalendarInfo. If you set the Cancel field of the DisplayAppointmentDialogEventArgs argument to true that will ccancel the standard appointment form.
Pat
I tried what you said, but the program never enters the section of code to handle the BeforeDisplayAppointmentDialog event. I will copy the section of code and perhaps you can elaborate further.
{ //Cancel standard appointment dialog form e.Cancel = true; //Call custom appointment dialog form from here Form apptForm = new Appointment(Name_TxtBox.Text, null, null, Phone_TxtBox.Text); apptForm.Show(); }
Thanks,
Nate
Do you connect the eventhandler at design time or run time? Did the standard appointfment form display?
The code you show looks OK but the problem looks as if it is related to attaching the event to the event handler.
I attempted to enable the event handler by calling this line of code in the constructor:
CalendarInfo.EventManager.SetEnabled(CalendarInfoEventIds.BeforeAppointmentAdded, true);
The standard form still displays and the code still never enters the function I posted previously.
You also need to connect the event handler to the event with a statement like
this.CalendarInfo.BeforeAppointmentAdded += new Infragistics.Win.UltraWinSchedule.CancelableAppointmentEventHandler(this.CalendarInfo_BeforeAppointmentAdded);
to get the event actually passed to the handler.
I tried the code you gave me, then altered it so that the program liked it and I ended up with this:
this.CalendarInfo.BeforeDisplayAppointmentDialog += new Infragistics.Win.UltraWinSchedule.DisplayAppointmentDialogEventHandler(this.CalendarInfo_BeforeDisplayAppointmentDialog);
It now works. Thank you very much for your help, Pat. You've helped my team save a lot of time.