private void button4_Click(object sender, EventArgs e) { Roll_comboBox.Text = "Select Roll No."; werror.Clear(); Roll_comboBox.Focus(); name_textview.Text = ""; class_textview.Text = ""; Report_textbox.Clear(); Technical_textbox.Clear(); Presentation_textbox.Clear(); total_textview.Text = ""; Remarks_textbox.Text = ""; werror.SetError(this.Report_textbox, ""); werror.SetError(this.Technical_textbox, ""); werror.SetError(this.Presentation_textbox, ""); }
private void Report_textbox_Leave(object sender, EventArgs e) { report_marks = Report_textbox.Text; double rm; Double.TryParse(report_marks, out rm); if (rm < 0 || rm > 10) { werror.SetError(this.Report_textbox, "Only marks Between 0 to 10 allowed"); Report_textbox.Focus(); } else { werror.SetError(this.Report_textbox, ""); werror.Clear(); } }