![]() |
| ||
| Windows Forms Input Validation with Validating Event and ErrorProvier Control Checking whether value is entered into a control and preventing focus to go out if no value is entered. |
private void txtName_Validating(object sender, CancelEventArgs e) { if (txtName.Text == "") { errorProvider1.SetError(txtName, "Name cannot be blank"); e.Cancel = true; } else errorProvider1.SetError(txtName, ""); }
| ||
| C# has internal parsing routines that also work nicely. Cheers, Bruce double x; |
| All times are GMT -4. The time now is 3:18 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC