Cita:
Iniciado por serbc27
Hola tengo un formulario que desde hay abro otro sin cerrar ninguno
Private Sub cmdEmpresas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEmpresas.Click
Dim oListadoEmpresas As New frmListadoEmpresas
oListadoEmpresas.Show()
End Sub
En el otro formulario tengo un datagriview que al hacer doble click, selecciona y devuelve el valor.
Private Sub dtListado_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtListado.DoubleClick
Dim oContrataciones As New frmContrataciones
If Me.dtListado.CurrentRow.Cells("nombre").Value.ToSt ring = " " Then
MsgBox("No hay ningun elemento seleccionado")
Exit Sub
Else
If Me.dtListado.CurrentRow.Cells("nombre").Value.ToSt ring = " " Then
MsgBox("No hay ningun elemento seleccionado")
Exit Sub
Else
oContrataciones.txtEmpresa.Text = dtListado.CurrentRow.Cells("nombre").Value
Me.Close()
End If
End If
End Sub
Pero oContrataciones.txtEmpresa.Text = dtListado.CurrentRow.Cells("nombre").Value no me hace nada
supongo que el formulario que llama a frmListadoEmpresas es frmContrataciones...
si al hacer doble CLICK vuelves a instanciar otra vez frmContrataciones, sera una ventana muy distinta a la que tienes ... intenta tu codigo sin instanciarla
Private Sub cmdEmpresas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEmpresas.Click
Dim oListadoEmpresas As New frmListadoEmpresas
oListadoEmpresas.Show()
End Sub
En el otro formulario tengo un datagriview que al hacer doble click, selecciona y devuelve el valor.
Private Sub dtListado_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtListado.DoubleClick
If Me.dtListado.CurrentRow.Cells("nombre").Value.ToSt ring = " " Then
MsgBox("No hay ningun elemento seleccionado")
Exit Sub
Else
oContrataciones.txtEmpresa.Text = dtListado.CurrentRow.Cells("nombre").Value
Me.Close()
End If
End Sub