protected override void OnPaint(PaintEventArgs pevent)
        {
            Graphics g = pevent.Graphics;

            ButtonRenderer.DrawParentBackground(g, ClientRectangle, this);
            float Angle = 90F;

            if (!isHotTracking)
            {
                paintGradientTop         = gradientTop;
                paintGradientBottom      = gradientBottom;
                paintGradientBorderColor = gradientBorderColor;
                paintForeColor           = ForeColor;
            }
            else
            {
                paintGradientTop         = _hotGradientTop;
                paintGradientBottom      = _hotGradientBottom;
                paintGradientBorderColor = _hotGradientBorderColor;
                paintForeColor           = _hotForeColor;
            }
            if (isPressed)
            {
                paintGradientTop         = _pressedGradientTop;
                paintGradientBottom      = _pressedGradientBottom;
                paintGradientBorderColor = _pressedGradientBorderColor;
                paintForeColor           = _pressedForeColor;
            }


            // Paint the outer rounded rectangle
            g.SmoothingMode = SmoothingMode.AntiAlias;
            using (GraphicsPath outerPath = RoundedRectangle(buttonRect, rectCornerRadius, 0))
            {
                using (LinearGradientBrush outerBrush = new LinearGradientBrush(buttonRect, Color.White, Color.White, LinearGradientMode.Vertical))
                {
                    g.FillPath(outerBrush, outerPath);
                }
                using (Pen outlinePen = new Pen(paintGradientBorderColor, rectOutlineWidth))
                {
                    outlinePen.Alignment = PenAlignment.Inset;
                    g.DrawPath(outlinePen, outerPath);
                }
            }
            // If this is the default button, paint an additional highlight
            if (IsDefault)
            {
                using (GraphicsPath defaultPath = new GraphicsPath())
                {
                    defaultPath.AddPath(RoundedRectangle(buttonRect, rectCornerRadius, 0), false);
                    defaultPath.AddPath(RoundedRectangle(buttonRect, rectCornerRadius, defaultHighlightOffset), false);
                    using (PathGradientBrush defaultBrush = new PathGradientBrush(defaultPath))
                    {
                        defaultBrush.CenterColor    = Color.FromArgb(50, Color.White);
                        defaultBrush.SurroundColors = new Color[] { Color.FromArgb(150, Color.White) };
                        g.FillPath(defaultBrush, defaultPath);
                    }
                }
            }
            // Paint the gel highlight
            using (GraphicsPath innerPath = RoundedRectangle(highlightRect, rectCornerRadius, highlightRectOffset))
            {
                //using (LinearGradientBrush innerBrush = new LinearGradientBrush(highlightRect, Color.FromArgb(highlightAlphaTop, Color.White), Color.FromArgb(highlightAlphaBottom, Color.White), LinearGradientMode.Vertical))
                //{
                g.FillPath(DrawingMethods.GetBrush(ClientRectangle, paintGradientTop, paintGradientBottom, DrawingMethods.PaletteColourStyle.Default, Angle, DrawingMethods.VisualOrientation.Top, false), innerPath);
                //g.FillPath(innerBrush, innerPath);
                //}
            }
            // Paint the text
            //TextRenderer.DrawText(g, Text, Font, buttonRect, paintForeColor, Color.Transparent, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);
            OnDrawTextAndImage(g);
        }