Using this method you can reset all controls in windows form in GroupBox and save time for writing code to reset all controls individually.
Code for Reset Controls
void ResetAll(GroupBox gbox)
{
foreach (Control ctrl in gbox.Controls)
{
if (ctrl is TextBox)
{
TextBox textBox = (TextBox)ctrl;
textBox.Text = null;
}
if (ctrl is ComboBox)
{
ComboBox comboBox = (ComboBox)ctrl;
comboBox.SelectedIndex = -1;
}

Rodolfo LopezPosted Aug 9, 2018, 12:28 AM
Very good, Thanks