111,097
社区成员




this.textBox1.Validating += new System.ComponentModel.CancelEventHandler(this.textBox1_Validating);
private void textBox1_Validating(object sender, CancelEventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
e.Cancel = true;
}
}
this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
private void textBox1_Leave(object sender, EventArgs e)
{
if (button1.Focused)
return;
if (textBox1.Text == "")
textBox1.Focus();
}
this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text == "")
textBox1.Focus();
}