I am doing my project in VS2012 Windows Forms using C#.
My probem is I am validating a textbox when the control loses focus; check it is empty or not. My textbox name is ChildFirstName and my code is:
private void ChildFirstName_Leave(object sender,EventArgs e)
{
if (ChildFirstName.Text == String.Empty)
{
ChildFirstName.Focus();
ChildFirstName.ForeColor = Color.Red;
}
}
But this is not working can anybody say what is the actual problem?
BackColorof the textbox to turn red, right? NotForeColor