日期:2014-05-18 浏览次数:20785 次
//重写按钮的OnPaint事件 class newbtn : System.Windows.Forms.Button //继承之系统按钮控件 { protected override void OnPaint(PaintEventArgs e) { //重写 base.OnPaint(e); System.Drawing.Pen pen = new Pen(this.BackColor, 3); e.Graphics.DrawRectangle(pen, 0, 0, this.Width, this.Height); //填充 pen.Dispose(); } } //然后将designer.cs文件中你要修改的按钮重新继承至newbtn就可。