一个按钮控制文本框的显示和隐藏 我的错在哪里???
namespace 11{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Visible = true;
textBox1.Visible = false;
}
}
}
2010-04-18 12:28
2010-04-18 13:23
程序代码:public Form1()
{
InitializeComponent();
button1.Text = textBox1.Visible ? "显示" : "隐藏";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Visible = !textBox1.Visible;
button1.Text = textBox1.Visible ? "隐藏" : "显示";
}
2010-04-18 13:27
2010-04-18 14:26
2010-04-18 22:33
2010-04-18 23:01
2010-04-19 15:58