3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by hericles
0

new creates objects, it doesn't 'clear records'. Can you be more descriptive of what you are trying to accomplish?

0

When you use new you create a blank version of the object in question (hence new). What records are you trying to clear? Most collections have a built in method to clear them of all current data.

0

AM TRYING TO CLEAR RECORDS FROM THE TEXBOXES N COMBOBOXES INSTEAD OF DOING IN MANUALLY

0

In that case you can loop through the controls in the form and either reset the text for all of them or for a particular type of control (textbox for example).

foreach (Control ctrl in this.Controls)
     {
          if (ctrl is TextBox)
          {
              ctrl.Text = "";
          } else if (ctrl is ComboBox) {
              ctrl.Items.Clear();
          }
     }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.