Back to Devexpress

How to: Display Custom Images for Appointments

windowsforms-2300-controls-and-libraries-scheduler-examples-appearance-how-to-display-custom-images-for-appointments.md

latest2.4 KB
Original Source

How to: Display Custom Images for Appointments

  • Dec 15, 2019

The following example handles the SchedulerControl.InitAppointmentImages event to display a custom image within the exception appointment.

The image below shows the result:

csharp
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Drawing;
// ...

private void schedulerControl1_InitAppointmentImages(object sender, AppointmentImagesEventArgs e) {
    if(e.Appointment.IsException) {
        AppointmentImageInfo info = new AppointmentImageInfo();
        info.Image = SystemIcons.Warning.ToBitmap();
        e.ImageInfoList.Add(info);
    }
}
vb
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraScheduler.Drawing
' ...

Private Sub SchedulerControl1_InitAppointmentImages(ByVal sender As Object, ByVal e As _
AppointmentImagesEventArgs) Handles SchedulerControl1.InitAppointmentImages
   If e.Appointment.IsException Then
      Dim info As AppointmentImageInfo = New AppointmentImageInfo()
      info.Image = SystemIcons.Warning.ToBitmap()
      e.ImageInfoList.Add(info)
   End If
End Sub

See Also

AppointmentViewInfoCustomizing

CustomDrawAppointment

CustomDrawAppointmentBackground

DrawDefault()

How to: Custom Paint Appointments

How to: Hide the Reminder (Bell) Icon for Outdated Appointments in a Series

How to: Custom Paint Day Headers

How to: Hide Grid Lines in the View