Example #1
0
 private void DrawBulkEditorInitialState(string cueBanner)
 {
     if (!string.IsNullOrEmpty(cueBanner))
     {
         ExtendedDateTimePicker extendedDateTimePicker = base.HostControl as ExtendedDateTimePicker;
         using (Graphics graphics = extendedDateTimePicker.CreateGraphics())
         {
             TextFormatFlags flags           = TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.NoPadding;
             Rectangle       clientRectangle = extendedDateTimePicker.ClientRectangle;
             clientRectangle.Width -= SystemInformation.VerticalScrollBarWidth;
             if (Application.RenderWithVisualStyles)
             {
                 clientRectangle.Offset(2, 2);
                 clientRectangle.Width--;
                 clientRectangle.Height -= 4;
             }
             else
             {
                 clientRectangle.Inflate(-2, -2);
             }
             Color color = extendedDateTimePicker.Enabled ? extendedDateTimePicker.BackColor : SystemColors.Control;
             using (SolidBrush solidBrush = new SolidBrush(color))
             {
                 graphics.FillRectangle(solidBrush, clientRectangle);
             }
             TextRenderer.DrawText(graphics, cueBanner, extendedDateTimePicker.Font, clientRectangle, extendedDateTimePicker.ForeColor, color, flags);
         }
     }
 }
Example #2
0
 public DateTimePickerBulkEditorAdapter(ExtendedDateTimePicker dateTimePicker) : base(dateTimePicker)
 {
     dateTimePicker.Painted     += this.OnAppearancePainted;
     dateTimePicker.FocusSetted += this.OnAppearancePainted;
     dateTimePicker.FocusKilled += this.OnAppearancePainted;
 }