private void butOK_Click(object sender, System.EventArgs e) { if (!IsMulti) { if (textToothNum.Text == "" || !Tooth.IsValidEntry(textToothNum.Text)) { MsgBox.Show(this, "Tooth number invalid."); return; } } //if IsMulti, it's ok to have date be blank, minval if (textDateExtracted.errorProvider1.GetError(textDateExtracted) != "") { MsgBox.Show(this, "Date invalid."); return; } if (!IsMulti) { Cur.ToothNum = Tooth.FromInternat(textToothNum.Text); } Cur.DateExtraction = PIn.PDate(textDateExtracted.Text); DialogResult = DialogResult.OK; }