private void BtncustomerEdit_Click(object sender, EventArgs e) { CCC = new CustomerConnectComponent(); CCC.musteriDuzenleControl((int)datagridview1.CurrentRow.Cells["CustomerID"].Value, txtcustomerName, txtCustomerSurname, txtcustomerTelephone, txtcustomerOccupotion, cmbcustomerReference, txtcustomerAccount, rctxtcustomerAddress, rctxtcustomerDetails); CCC.musteriListe(datagridview1); CCC.cmboboxReferansDoldur(cmbcustomerReference); foreach (var item in this.groupBox3.Controls) { if (item is TextBox) { TextBox tx = (TextBox)item; tx.Clear(); } else if (item is NumericUpDown) { NumericUpDown num = (NumericUpDown)item; num.Value = 0; } else if (item is RichTextBox) { RichTextBox rx = (RichTextBox)item; rx.Clear(); } else if (item is MaskedTextBox) { MaskedTextBox ms = (MaskedTextBox)item; ms.Clear(); } } }