by this way we can call a form and get the values \u200b\u200bto continue the process.
function from which you call the new form is on standby until the way back to get focus
Dim F As New buscar_cliente
F. Owner = Me
F. ShowDialog ()
TextBox1.Text = Trim (F.textb)
for the reverse process, send values \u200b\u200bto the form that we use the following call:
form in the place we call an initializer with the number of parameters that we will send the form. in fiery form instantiate the form "form2" by putting the parameters that we will send you (at this moment the values \u200b\u200bobtained form 2).
To prevent the form to which the caller continues with the process, call the ShowDialog and form 2 as close to the way that we find over and destroy the instance created using dispose.
Public Class Form1 Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2 (1)
frm.ShowDialog()
frm.Dispose()
End Sub
End Class
Public Class Form2
Dim m_cod_cli
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub New(ByVal cod_cli As Integer)
InitializeComponent()
' Asignamos al campo el valor pasado
m_cod_cli = cod_cli
End Sub
End Class
0 comments:
Post a Comment