日期:2014-05-17 浏览次数:21069 次
private void textBox_Validating(object sender, CancelEventArgs e)
{
TextBox tb = (TextBox)sender;
if (tb.TextLength == 0)
tb.BackColor = Color.Red;
else
tb.BackColor = System.Drawing.SystemColors.Window;
Validate();//改成Validating()出错、改成Validated()出错、改成ValidateOK()出错
//求高手帮助 书上写的是ValidateOK()《C#入门经典第五版
}