private void button20_Click(object sender, EventArgs e) { HeightBox.Clear(); LengthBox.Clear(); WidthBox.Clear(); AreaBox.Clear(); PermiterBox.Clear(); VolumeBox.Clear(); }
//WidthBox Validation private void WidthBox_Validating(object sender, CancelEventArgs e) { string errorMsg; if (!ValidWidth(WidthBox.Text, out errorMsg)) { //Cancel the event and select the text to be corrected by the user. e.Cancel = true; WidthBox.Select(0, WidthBox.Text.Length); //Set the ErrorProvider error with the text to display. this.errorProvider1.SetError(WidthBox, errorMsg); } }