Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/06/2010, 11:45
Avatar de Highlander
Highlander
 
Fecha de Ingreso: junio-2006
Ubicación: Concepción, Chile
Mensajes: 475
Antigüedad: 17 años, 10 meses
Puntos: 4
Respuesta: Form se cierra cuando ejecuto evento del boton?

Desde Form Producto con este evento llamo a form Stock:
Código:
Private Sub btnNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNuevo.Click

        Dim frmStock As frmStock = frmStock.Instance

        'Parametro del form 
        frmStock.Opcion = "Nuevo"

        'Muestro el form
        frmStock.ShowDialog()

End Sub

El codigo de la Form Stock:
Código:
Public Class frmStock

    'Variables Globales
    Public CodigoStock As Integer = Nothing
    Public Opcion As String = Nothing

    'Variable pública.
    Private Shared ChildInstance As frmStock = Nothing

    'controla que sólo exista una instancia del formulario.
    Public Shared Function Instance() As frmStock
        If ChildInstance Is Nothing OrElse ChildInstance.IsDisposed = True Then
            ChildInstance = New frmStock()
        End If
        ChildInstance.BringToFront()

        Return ChildInstance
    End Function

    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

   
    Private Sub btnGuardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGuardar.Click

       

    End Sub
End Class
__________________
Ingeniero (E) en Computación e Informática
The last man alone with god.