void doubleclic_grid() { try { FrmActivites frm = new FrmActivites(); int i; i = dgActivite.CurrentRow.Index; frm.id = Convert.ToInt32(dgActivite["ColId", i].Value.ToString()); frm.activCombo.Text = dgActivite["ColActivite", i].Value.ToString(); frm.descTxt.Text = dgActivite["ColDesc", i].Value.ToString(); //frm.dateTxt.Text = dgActivite["ColDate", i].Value.ToString(); frm.heureTxt.Text = dgActivite["ColHeure", i].Value.ToString(); //frm.departTxt.Text = dgActivite["ColDepart", i].Value.ToString(); frm.dgDepart.Rows.Add(dgActivite["ColRefDepart", i].Value.ToString(), dgActivite["ColDepart", i].Value.ToString()); frm.departTxt.SelectedIndex = -1; frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show("L'erreur suivant est survenue : " + ex.Message); } }
private void button1_Click(object sender, EventArgs e) { FrmActivites frm = new FrmActivites(); frm.ShowDialog(); }