I am trying to create a (a) link between 2 forms, well the main one is of type MDI (first form) so in the second form I have a DataGridView and when I select a row, I created a variable that takes its value and immediately with a button I show the variable in the form 3, well I leave some reference images. in the FRM_Nuevo (2)
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
Try
Dim i As Integer
Dim selecionar_columna As DataGridViewRow
i = e.RowIndex
selecionar_columna = DataGridView1.Rows(i)
a = selecionar_columna.Cells(0).Value 'variable enlace (a)
Catch ex As Exception
'no pasa nada
End Try
End Sub
In the Frm_Editar (3)
Public Class Frm_Editar
Public a As Integer
Private Sub Frm_Editar_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label.Text = a 'esto funciona solo al iniciar el formulario
End Sub
End Class
I would like you to click on the DataGridView1 and with the open form 3, change the text of the Label, can you do it ?, I need your help and if there is something you have not understood about my question, do not hesitate to let me know .