Dear All,
I am new to VB2010 and writing a MDI child form to open another form as dialogbox, then pass a value back to the MDI child form, the value is successfully passed back to the MDI child form but it can't be shown on a text box, my code as below, can somebody help on this
(on mdiForm1)
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
Dim F As New Form
F = Form2
F.ShowDialog()
End Sub
Public Sub setText(ByVal nsc As String)
MessageBox.Show(nsc) 'it shows the correct value on screen
txtStaffCode.Text = nsc
End Sub
(on Form2)
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Dim nsc As String = lblNewCode.Text
Call mdiForm1.setText(nsc)
Me.Close()
End Sub