void doubleclic_grid() { try { Agent_Form frm = new Agent_Form(); int i; i = dataGridView1.CurrentRow.Index; frm.idAgent = Convert.ToInt32(dataGridView1["ColId", i].Value.ToString()); frm.textBox1.Text = dataGridView1["ColNom", i].Value.ToString(); frm.textBox3.Text = dataGridView1["ColAdresse", i].Value.ToString(); frm.textBox2.Text = dataGridView1["ColEmail", i].Value.ToString(); label16.Text = dataGridView1["ColSex", i].Value.ToString(); frm.textBox6.Text = dataGridView1["ColFonction", i].Value.ToString(); frm.textBox5.Text = dataGridView1["ColPseudo", i].Value.ToString(); frm.textBox7.Text = dataGridView1["ColPassword", i].Value.ToString(); frm.comboBox2.Text = dataGridView1["ColNiveau", i].Value.ToString(); frm.textBox6.Text = dataGridView1["ColFonction", i].Value.ToString(); frm.textBox4.Text = dataGridView1["ColContact", i].Value.ToString(); frm.textBox7.Enabled = false; frm.button1.Enabled = false; if (dataGridView1["ColSex", i].Value.ToString() == "Masculin") { frm.radioButton1.Checked = true; } else { frm.radioButton2.Checked = true; } loadPhoto("photo", dataGridView1["ColId", i].Value.ToString(), frm.pictureBox2); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show("L'erreur suivant est survenue : " + ex.Message); } }
private void button2_MouseClick(object sender, MouseEventArgs e) { Agent_Form frma = new Agent_Form(); frma.ShowDialog(); }