public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//this.label3.Paint+= label1_Paint;
//this.label4.Paint += label1_Paint;
}
private void label1_Paint(object sender, PaintEventArgs e)
{
ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, Color.LimeGreen, ButtonBorderStyle.Solid);//画个边框
}
private void button1_Click(object sender, EventArgs e)
{
Label lb = this.label3;
ControlPaint.DrawBorder(lb.CreateGraphics(),lb.ClientRectangle,Color.LimeGreen, ButtonBorderStyle.Solid);
}
}