如果是这样,点击文本框文字就消失了.
private void textBox1_Click(object sender, EventArgs e)
{
this.textBox1.Text = "";//或者 this.textBox1.Text = string.Empty;
//如果在系统中设置了获取焦点,清空this.textBox1.Text ,那么,请检查
}
//如果这样,也会造成文字消失.
private void textBox1_Enter(object sender, EventArgs e)
{
this.textBox1.Text = string.Empty;
}
温馨提示:答案为网友推荐,仅供参考