void doubleclic_grid() { try { FrmDepense frm = new FrmDepense(); int i; i = dgFinance.CurrentRow.Index; frm.id = Convert.ToInt32(dgFinance["ColId", i].Value.ToString()); frm.montantTxt.Text = dgFinance["ColMont", i].Value.ToString(); frm.departCombo.Text = dgFinance["ColDepart", i].Value.ToString(); frm.sourceCombo.Text = dgFinance["ColSource", i].Value.ToString(); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show("L'erreur suivant est survenue : " + ex.Message); } }
private void button1_Click(object sender, EventArgs e) { FrmDepense frm = new FrmDepense(); frm.ShowDialog(); }