G
Guest
I am using a switch statement, to check for valid user hours. If the hours
control is blank, I want to place the cursor back to the hours control for
the user.
The following code does NOT work:
switch (txtHours.Text)
{
case "":
MessageBox.Show("No hours entered.\nYou must enter hours
for this record.", "Bad Value for Hours", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtHours.Focus();
break;
default:
break;
}
Has anybody tried to do this before? Am I using it incorrectly?
Thanks,
Terry
control is blank, I want to place the cursor back to the hours control for
the user.
The following code does NOT work:
switch (txtHours.Text)
{
case "":
MessageBox.Show("No hours entered.\nYou must enter hours
for this record.", "Bad Value for Hours", MessageBoxButtons.OK,
MessageBoxIcon.Error);
txtHours.Focus();
break;
default:
break;
}
Has anybody tried to do this before? Am I using it incorrectly?
Thanks,
Terry