Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear or regenerate window form after submitting using c#?

I am using student record entry window form. I want that after submitting data, all fields of form(i.e radio button, combobox etc) and messages(warning and successful) should be reset so that new user can add data.

  • is their any built in function to reset form in csharp?
  • or I have to write clear method for this?
  • or can I regenerate the form?
like image 902
Touseef Khan Avatar asked Dec 04 '22 22:12

Touseef Khan


1 Answers

You must first clear the controls and then use InitializeComponent method to work perfectly.

this.Controls.Clear();
this.InitializeComponent();
like image 67
Appyks Avatar answered May 26 '23 14:05

Appyks