windowsforms-6201-controls-and-libraries-scheduler-examples-recurrence-how-to-create-appointments-with-various-recurrence-types-programmatically.md
This document illustrates how recurring appointments with different periodicity and number of occurrences can be created in code. Many examples are provided to help you in specifying complex periodical conditions.
Follow the steps listed below. First, create a new appointment pattern. Then, modify its recurrence information as required via the Appointment.RecurrenceInfo property. You can specify only one type of recurrence - every minute, hour, day, week, or year. Finally, add the appointment to the storage.
An appointment pattern which starts at 3 AM on the current date finishes at 8:15 will be created. So the first appointment in a series will start at 3 AM and will last for 15 minutes.
Appointment apt = scheduler.Storage.CreateAppointment(AppointmentType.Pattern);
apt.Start = DateTime.Today.AddHours(3);
apt.End = apt.Start.AddMinutes(15);
apt.Subject = "My Subject";
apt.Location = "My Location";
apt.Description = "My Description";
Dim apt As Appointment = scheduler.Storage.CreateAppointment(AppointmentType.Pattern)
apt.Start = Date.Today.AddHours(3)
apt.End = apt.Start.AddMinutes(15)
apt.Subject = "My Subject"
apt.Location = "My Location"
apt.Description = "My Description"
Recurrence - Minutely (examples)
Recurrence - Hourly (examples)
Recurrence - Weekly (examples)
Recurrence - Monthly (examples)
Recurrence - Yearly (examples)
Recurrence - Exceptions (examples)
And finally, add an appointment to the storage:
schedulerControl1.Storage.Appointments.Add(apt);
schedulerControl1.Storage.Appointments.Add(apt)
See Also