Code the mouse click event on the datagrid to fire and pass the information to your new form
Excuse the code, it's not well written but it will get you the results you want.
Mouse Code:
Private Sub dg_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dg.MouseDoubleClick
frmNewForm.loadInfo(dg.Rows(dg.
SelectedRows
(0).Index).Cells(';FirstName';), dg.Rows(dg.SelectedRows
(0).Index).Cells(';LastName';))
End Sub
Then on your second form have the relevent method to call
Public sub loadInfo(byref sFirst as string, byref sLast as string)
txtFirstname.text = sFirst
txtLastname.text = sLast
me.show
end sub
No comments:
Post a Comment