Scheduler for WinForms | ComponentOne
Scheduler Control / Appointments / Labels / Assigning Custom Labels to an Appointment
In This Topic
    Assigning Custom Labels to an Appointment
    In This Topic

    You can also add custom labels using the Label property. The following code, added to the Form_Load event, assigns a custom Meeting label to an appointment:

    C#
    Copy Code
    // Create a new appointment.   
    C1.C1Schedule.Appointment app1 = this.c1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();
    // Make the appointment an all day event.   
    app1.Start = new DateTime(2021, 11, 02, 13, 30, 0);
    app1.AllDayEvent = true;
    // Set some details for the appointment.   
    app1.Subject = "Training";
    app1.Location = "Large Conference Room";
    // Assign a custom label to the appointment.       
    app1.Label = new C1.C1Schedule.Label(Color.DeepSkyBlue, "Meeting", "Meeting");