//文本框内容变动事件
private void textBox5_TextChanged(object sender, EventArgs e)
{
this.label5.Text = textBox5.Text;
}
//验证文本框内容时发生
private void textBox5_Validating(object sender, CancelEventArgs e)
{
if (textBox5.Text == "")
{
MessageBox.Show("文本框5没有输入值!");
}
}
//经测试先发生validating事件,而后是validated事件
//而且此事件发生的前提是文本先获到焦点而后失去焦点
private void textBox5_Validated(object sender, EventArgs e)
{
if (textBox5.Text == "")
{
MessageBox.Show("验证完了文本框5没有输入值!");
}
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
this.label5.Text = textBox5.Text;
}
//验证文本框内容时发生
private void textBox5_Validating(object sender, CancelEventArgs e)
{
if (textBox5.Text == "")
{
MessageBox.Show("文本框5没有输入值!");
}
}
//经测试先发生validating事件,而后是validated事件
//而且此事件发生的前提是文本先获到焦点而后失去焦点
private void textBox5_Validated(object sender, EventArgs e)
{
if (textBox5.Text == "")
{
MessageBox.Show("验证完了文本框5没有输入值!");
}
}