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 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.
Nate
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.
Pat
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.
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 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,