private void Btn_Create_Click(object sender, EventArgs e) { City c = new City(); c.Name = tx_CityName.Text; c.CountryCode = tx_CountryCode.Text; c.District = tx_District.Text; c.Population = tx_Population.Text; var caller = new myAPIcaller(); caller.AddCity(c); displayAllCaller(); foreach (Control tx in panel1.Controls) { if (tx is TextBox) { tx.Text = ""; } } }