Ejemplo n.º 1
0
 /// <summary>
 /// Draw text.
 /// </summary>
 /// <param name="graphics">Graphics.</param>
 public virtual void DrawText(Graphics graphics)
 {
     using (var fgbrush = new SolidBrush(ForeColor))
         using (var format = IronideConvert.ToStringFormat(TextAlign))
             graphics.DrawString(Text, Font, fgbrush,
                                 ShowTitlebar ?
                                 new Rectangle(BorderThickness,
                                               titlePanel.Location.Y + titlePanel.Height, Width - BorderThickness,
                                               Height - (titlePanel.Location.Y + titlePanel.Height))
                 : new Rectangle(
                                     BorderThickness, BorderThickness,
                                     Width - BorderThickness, Height - BorderThickness),
                                 format);
 }
Ejemplo n.º 2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (Image == null)
            {
                DrawText(e.Graphics);
            }
            else
            {
                var X = ImageLocation.X + ImageSize.Width;
                e.Graphics.DrawImage(Image, new Rectangle(ImageLocation, ImageSize));
                using (var fgbrush = new SolidBrush(ForeColor))
                    using (var format = IronideConvert.ToStringFormat(TextAlign))
                        e.Graphics.DrawString(Text, Font, fgbrush, new Rectangle(
                                                  X, 0, Width - X, Height), format);
            }

            DrawBorder(e.Graphics);
            DrawEnable(e.Graphics);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Draw text.
 /// </summary>
 /// <param name="graphics">Graphics.</param>
 public virtual void DrawText(Graphics graphics)
 {
     using (var fgbrush = new SolidBrush(ForeColor))
         using (var format = IronideConvert.ToStringFormat(TextAlign))
             graphics.DrawString(Text, Font, fgbrush, ClientRectangle, format);
 }