Exemple #1
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaintBackground(e);
     checked
     {
         if (base.BorderStyle == BorderStyle.FixedSingle)
         {
             ControlPaint.DrawBorder(e.Graphics, new Rectangle(0, 0, base.ClientRectangle.Width - 1, base.ClientRectangle.Height - 1), this._borderColor, ButtonBorderStyle.Solid);
         }
         else
         {
             if (VisualStyleRenderer.IsSupported && Application.RenderWithVisualStyles)
             {
                 ControlPaint.DrawVisualStyleBorder(e.Graphics, new Rectangle(0, 0, base.ClientRectangle.Width - 1, base.ClientRectangle.Height - 1));
             }
             else
             {
                 ControlPaint.DrawBorder3D(e.Graphics, new Rectangle(0, 0, base.ClientRectangle.Width - 1, base.ClientRectangle.Height - 1), Border3DStyle.Sunken);
             }
         }
     }
 }