void CustomDrawAppointmentFlyoutSubject(Appointment appointment, AppointmentBandDrawerViewInfoBase viewInfo) { GraphicsCache cache = viewInfo.Cache; StringFormat stringFormat = new StringFormat(viewInfo.View.Appearance.GetStringFormat()); stringFormat.Alignment = stringFormat.LineAlignment = StringAlignment.Center; try { // Draw status Rectangle statusRect = GetStatusBounds(viewInfo); cache.FillRectangle(viewInfo.View.Status.GetBrush(), statusRect); if (viewInfo.View.Status.Type == AppointmentStatusType.Free) { // Draw a warning cache.DrawImage(GetWarningIcon(new Size(statusRect.Height, statusRect.Height)), statusRect.Location); cache.DrawString("Status is unacceptable", fontStorage.StatusFont, Brushes.Red, statusRect, stringFormat); } // Draw subject cache.DrawString(appointment.Subject, fontStorage.SubjectFont, Brushes.Black, GetSubjectBounds(viewInfo), stringFormat); } finally { stringFormat.Dispose(); } }