Foros del Web » Programación para mayores de 30 ;) » .NET »

No pasa valores

Estas en el tema de No pasa valores en el foro de .NET en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 09/02/2010, 11:58
 
Fecha de Ingreso: febrero-2007
Mensajes: 165
Antigüedad: 17 años, 2 meses
Puntos: 0
No pasa valores

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
  #2 (permalink)  
Antiguo 09/02/2010, 12:57
 
Fecha de Ingreso: marzo-2004
Mensajes: 70
Antigüedad: 20 años, 1 mes
Puntos: 0
Respuesta: No pasa valores

Cita:
Iniciado por serbc27 Ver Mensaje
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
__________________
GuzZpaWn
  #3 (permalink)  
Antiguo 09/02/2010, 13:51
 
Fecha de Ingreso: febrero-2007
Mensajes: 165
Antigüedad: 17 años, 2 meses
Puntos: 0
Respuesta: No pasa valores

Yo lo que quiero hacer es

desde frmContrataciones abrir frmListadoEmpresas, sin cerrar frmContrataciones, donde en frmListadoEmpresas, hay un DataGridView, que recoge todas los datos de las empresas.

Lo que quiero hacer es seleccionar una empresa del DataGridView, y pasar el nombre de la empresa al txtEmpresa que hay en frmContrataciones, y cerrar frmListadoEmpresas

Espero que ahora se me haya entendido

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:33.