I have a form (let's call it 1) that opens a new form (2) where you can choose a client from a datagridview. When the user clicks accept in form (2), I create an object and I pass it to form (1). This is code from the accept button in form (2):
Private objCreateOrder As FCreateOrder = New FCreateOrder
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
If selectedRow Is Nothing Then
MessageBox.Show("Error.")
Else
Me.Close()
objCreateOrder.getClientObject(objClient)
End If
End Sub
This is the function from form (1) that was called above:
Public Sub getClientObject(client As CClient)
Dim objClient As CClient = New CClient
objClient = client
txtClient.Text = objClient._name.ToString + " " + objClient._surname.ToString
End Sub
When I debug I see that the object was passed correctly, and that the textbox has exactly the strings it needs. Also, if I add something like MessageBox.Show() to show anything just to check if the code runs what is inside the method it works, but the textbox doesn't show anything. What am I missing?