往窗体百中添加一个 label 两个度Button 控件
添加两个按钮的问单击事件,如答下:
private void button1_Click(object sender, EventArgs e)
{
label1.Visible = true;
label1.Text = "努力学习C#";
label1.BackColor = Color.Blue;//背景颜色回为蓝色
label1.Location = new Point(50, 50);//位置答
}
private void button2_Click(object sender, EventArgs e)
{
label1.Text = "";
label1.Visible = false;//隐藏
label1.BackColor = Color.White;
}