private void DeskDepth_Validating(object sender, CancelEventArgs e) { bool result = checkDepth(); string errorMessage = "Depth not correct"; if (!result) { DeskWidth.Select(0, DeskWidth.Text.Length); System.Windows.Forms.MessageBox.Show(errorMessage); } }
private void DeskWidth_Validating(object sender, System.ComponentModel.CancelEventArgs e) { bool result = checkWidth(); string errorMessage = "Width not correct"; if (!result) { e.Cancel = true; DeskWidth.Select(0, DeskWidth.Text.Length); //System.Windows.Forms.MessageBox.Show(errorMessage); } }