示例#1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (BackColor.A < 255)
            {
                InvokePaintBackground(this, e);
            }
            else
            {
                e.Graphics.Clear(BackColor);
            }

            Color color = IsHover ? HoverColor : ForeColor;

            e.Graphics.DrawString(Text, Font, new SolidBrush(color), ClientRectangle, PaintHelper.TranslateContentAlignment(TextAlign));
        }