1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
Dim currentRow As Integer
'Click sur la bouton Modifier
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
Form2.TextBox1.Text = DataGridView1.Item("Nom", currentRow).Value
Form2.TextBox2.Text = DataGridView1.Item("Prenom", currentRow).Value
End Sub
'Click dans gridView sur la bouton Slelectioner
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
currentRow = e.RowIndex
End Sub |