protected void DrawCheckBackgroundFlat(PaintEventArgs e, Rectangle bounds, Color borderColor, Color checkBackground, bool disabledColors)
        {
            Color control             = checkBackground;
            Color contrastControlDark = borderColor;

            if (!this.Control.Enabled && disabledColors)
            {
                contrastControlDark = ControlPaint.ContrastControlDark;
                control             = SystemColors.Control;
            }
            float dpiScaleRatio = CheckableControlBaseAdapter.GetDpiScaleRatio(e.Graphics);

            using (WindowsGraphics graphics = WindowsGraphics.FromGraphics(e.Graphics))
            {
                using (WindowsPen pen = new WindowsPen(graphics.DeviceContext, contrastControlDark))
                {
                    using (WindowsBrush brush = new WindowsSolidBrush(graphics.DeviceContext, control))
                    {
                        if (dpiScaleRatio > 1.1)
                        {
                            bounds.Width--;
                            bounds.Height--;
                            graphics.DrawAndFillEllipse(pen, brush, bounds);
                            bounds.Inflate(-1, -1);
                        }
                        else
                        {
                            DrawAndFillEllipse(graphics, pen, brush, bounds);
                        }
                    }
                }
            }
        }
        protected void DrawCheckBackgroundFlat(PaintEventArgs e, Rectangle bounds, Color borderColor, Color checkBackground, bool disabledColors)
        {
            Color field  = checkBackground;
            Color border = borderColor;

            if (!Control.Enabled && disabledColors)
            {
                border = ControlPaint.ContrastControlDark;
                field  = SystemColors.Control;
            }

            float scale = GetDpiScaleRatio(e.Graphics);

            using (WindowsGraphics wg = WindowsGraphics.FromGraphics(e.Graphics)) {
                using (WindowsPen borderPen = new WindowsPen(wg.DeviceContext, border)) {
                    using (WindowsBrush fieldBrush = new WindowsSolidBrush(wg.DeviceContext, field)) {
                        // for Dev10 525537, in high DPI mode when we draw ellipse as three rectantles,
                        // the quality of ellipse is poor. Draw it directly as ellipse
                        if (scale > 1.1)
                        {
                            bounds.Width--;
                            bounds.Height--;
                            wg.DrawAndFillEllipse(borderPen, fieldBrush, bounds);
                            bounds.Inflate(-1, -1);
                        }
                        else
                        {
                            DrawAndFillEllipse(wg, borderPen, fieldBrush, bounds);
                        }
                    }
                }
            }
        }
        protected void DrawCheckBackgroundFlat(PaintEventArgs e, Rectangle bounds, Color borderColor, Color checkBackground)
        {
            Color field  = checkBackground;
            Color border = borderColor;

            if (!Control.Enabled)
            {
                // if we are not in HighContrast mode OR we opted into the legacy behavior
                if (!SystemInformation.HighContrast)
                {
                    border = ControlPaint.ContrastControlDark;
                }
                // otherwise we are in HighContrast mode
                field = SystemColors.Control;
            }

            double scale = GetDpiScaleRatio(e.Graphics);

            using (WindowsGraphics wg = WindowsGraphics.FromGraphics(e.Graphics))
            {
                using (WindowsPen borderPen = new WindowsPen(wg.DeviceContext, border))
                {
                    using (WindowsBrush fieldBrush = new WindowsSolidBrush(wg.DeviceContext, field))
                    {
                        // In high DPI mode when we draw ellipse as three rectantles,
                        // the quality of ellipse is poor. Draw it directly as ellipse
                        if (scale > 1.1)
                        {
                            bounds.Width--;
                            bounds.Height--;
                            wg.DrawAndFillEllipse(borderPen, fieldBrush, bounds);
                            bounds.Inflate(-1, -1);
                        }
                        else
                        {
                            DrawAndFillEllipse(wg, borderPen, fieldBrush, bounds);
                        }
                    }
                }
            }
        }