Back to Devexpress

MonthViewAppointmentDisplayOptionsEx.ShowClippedImages Property

windowsforms-devexpress-dot-xtrascheduler-dot-monthviewappointmentdisplayoptionsex-a147475c.md

latest5.3 KB
Original Source

MonthViewAppointmentDisplayOptionsEx.ShowClippedImages Property

Gets or sets whether Month View appointments should draw truncated images when these appointments are too small to display their images entirely.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public bool ShowClippedImages { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Property ShowClippedImages As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true , to display clipped images inside small appointments; false to only draw images that fit into appointments.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ShowClippedImages
MonthView

.AppointmentDisplayOptions .ShowClippedImages

|

Remarks

Scheduler control hides appointment images and text strings if an appointment is too small to display this content. Images hide when there is not enough either vertical or horizontal space.

How to provide appointment images

In the animation above, images for all appointments labeled as “Important” are assigned on the SchedulerControl.InitAppointmentImages event.

csharp
private void SchedulerControl_InitAppointmentImages(object sender, AppointmentImagesEventArgs e) {
    if (Object.Equals(e.Appointment.LabelKey, 1)) { //"Important" label
        AppointmentImageInfo info = new AppointmentImageInfo();
        info.Image = SystemIcons.Warning.ToBitmap();
        e.ImageInfoList.Add(info);
    }
}
vb
Private Sub SchedulerControl_InitAppointmentImages(ByVal sender As Object, ByVal e As AppointmentImagesEventArgs)
    If Object.Equals(e.Appointment.LabelKey, 1) Then '"Important" label
        Dim info As New AppointmentImageInfo()
        info.Image = SystemIcons.Warning.ToBitmap()
        e.ImageInfoList.Add(info)
    End If
End Sub

Appointment text hides only when it does not fit vertically. In Timeline and Month Views, this can happen when you manually reduce the appointment height.

csharp
schedulerControl1.MonthView.AppointmentDisplayOptions.AppointmentHeight = 15;
vb
schedulerControl1.MonthView.AppointmentDisplayOptions.AppointmentHeight = 15

In Day and Week Views, text hides if the font is higher than a time cell.

How to enlarge appointment text

Time cells in Day and Week Views adapt to appointment font settings when you set them through the BaseViewAppearance.Appointment object. For that reason, cells can be lacking height only when you change font settings dynamically, i.e. on the SchedulerControl.AppointmentViewInfoCustomizing event.

csharp
private void SchedulerControl_AppointmentViewInfoCustomizing(object sender, AppointmentViewInfoCustomizingEventArgs e) {
    e.ViewInfo.Appearance.FontSizeDelta = 10;
}
vb
Private Sub SchedulerControl_AppointmentViewInfoCustomizing(ByVal sender As Object, ByVal e As AppointmentViewInfoCustomizingEventArgs)
    e.ViewInfo.Appearance.FontSizeDelta = 10
End Sub

To force appointments to draw their texts and images even when there is not enough space, enable the ShowClippedText and ShowClippedImages settings.

You can access these settings through the View’s AppointmentDisplayOptions. For instance, for Day View:

csharp
schedulerControl1.DayView.AppointmentDisplayOptions.ShowClippedImages = true;
schedulerControl1.DayView.AppointmentDisplayOptions.ShowClippedText = true;
vb
schedulerControl1.DayView.AppointmentDisplayOptions.ShowClippedImages = True
schedulerControl1.DayView.AppointmentDisplayOptions.ShowClippedText = True

See Also

MonthViewAppointmentDisplayOptionsEx Class

MonthViewAppointmentDisplayOptionsEx Members

DevExpress.XtraScheduler Namespace