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