private void button1_Click(object sender, EventArgs e) { int validite = 0; if (txtcodecompte.Text.Equals("")) { validite = 1; txtcodecompte.Text = "Remplissez le champ"; MessageBox.Show("Entrez le numero du compte a rechercher", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { bool cl = objetcompte.RechercherCompte(txtcodecompte.Text); if (!cl.Equals(false)) { this.Size = new Size(429, 415); txtcodeclient.Text = objetcompte.RecupererNumeroClient(); txtmontant.Text = objetcompte.RecupererSolde().ToString(); txttype.Text = objetcompte.RecupererType(); txtdevise.Text = objetcompte.RecupererDevise(); txtdatecreation.Text = objetcompte.RecupererDatecreation(); txtetat.Text = objetcompte.RecupererEtat(); } } catch (Exception) { MessageBox.Show("Ce compte n'existe pas", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }