Exemple #1
0
        internal static void Draw(Graphics graphics, Pen pen, Rectangle rect, Color backColor, ControlStyle controlStyle)
        {
            // Fill rectangle
            graphics.FillRectangle(SolidBrushCache.GetInstance().Get(backColor), rect);

            // Draw border
            BorderRenderer.PaintBorder(graphics, pen, rect, controlStyle, false);
        }
Exemple #2
0
        internal static void Draw(Graphics graphics, Pen pen, Rectangle rect, Color backColor, ControlStyle controlStyle)
        {
            // Fill  the ellipse . In this case reduce the height and width of rect by 1 so that it is painted filled only inside the border
            graphics.FillEllipse(SolidBrushCache.GetInstance().Get(backColor), new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1));

            // Draw border
            if (rect.Width > 1 && rect.Height > 1)
            {
                BorderRenderer.DrawEllipseBorder(graphics, pen, rect, controlStyle);
            }
        }
Exemple #3
0
        internal static void DrawRoundedRectangle(Graphics graphics, Pen pen, Rectangle clientRectangle, Color backColor, ControlStyle controlStyle)
        {
            int xRadius = clientRectangle.Width / 8;
            int yRadius = clientRectangle.Height / 8;

            if (xRadius > 2 && yRadius > 2)
            {
                // Fill Rounded Rectangle
                GraphicsExtension.FillRoundedRectangle(graphics, SolidBrushCache.GetInstance().Get(backColor), clientRectangle.X, clientRectangle.Y, clientRectangle.Width, clientRectangle.Height, xRadius, yRadius);

                // Draw border
                GraphicsExtension.DrawRoundedRectangle(graphics, pen, clientRectangle.X, clientRectangle.Y, clientRectangle.Width, clientRectangle.Height, xRadius, yRadius);
            }
        }
Exemple #4
0
 /// <summary>
 /// Paint background color and border excluding clip rectangle of Group box control.
 /// </summary>
 /// <param name="g"></param>
 /// <param name="bounds"></param>
 /// <param name="pen"></param>
 /// <param name="backColor"></param>
 /// <param name="controlStyle"></param>
 /// <param name="textRect"></param>
 /// <param name="font"></param>
 /// <param name="keepTopBorderMargin"></param>
 internal static void Draw(Graphics g, Rectangle bounds, Pen pen, Color backColor, ControlStyle controlStyle, Rectangle textRect, Font font, bool keepTopBorderMargin)
 {
     // Fill  rectangle
     g.FillRectangle(SolidBrushCache.GetInstance().Get(backColor), bounds);
     DrawBorder(g, bounds, pen, controlStyle, textRect, font, keepTopBorderMargin);
 }