Sending information to and from different forms
-
I am currently developing a system as a project for an university subject but is struggeling with something that is affecting everything in the system. I have an open form, where you enter information on a school / university. On the form you click on a button to register a contact person for that school / university. This button opens another form (the contact person form). After completing all the necessary contact's information and close the form, the contact person's name, surname and telephone must be showed in the previous form. How on earth do you send the information from the contact form to the previous form (that is still open)????? Can anybody help me?!? This is very important, for my whole project depends on this!!! :((
-
I am currently developing a system as a project for an university subject but is struggeling with something that is affecting everything in the system. I have an open form, where you enter information on a school / university. On the form you click on a button to register a contact person for that school / university. This button opens another form (the contact person form). After completing all the necessary contact's information and close the form, the contact person's name, surname and telephone must be showed in the previous form. How on earth do you send the information from the contact form to the previous form (that is still open)????? Can anybody help me?!? This is very important, for my whole project depends on this!!! :((
try this : In Form1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2()
Me.AddOwnedForm(frm2) '/// add it as an owned form.
frm2.Show() '/// show it.
End Sub
In Form2:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm1 As Form1 = Me.Owner
frm1.TextBox1.AppendText("some text from Form2 , to Form1!")
End Sub
hope it helps :) Vb:
Public Function TwinsOnWay(ByVal twins As String) As String
Select Case twins
Case "Gender"
Return "Two Girls"
End Select
End Function
-
try this : In Form1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2()
Me.AddOwnedForm(frm2) '/// add it as an owned form.
frm2.Show() '/// show it.
End Sub
In Form2:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm1 As Form1 = Me.Owner
frm1.TextBox1.AppendText("some text from Form2 , to Form1!")
End Sub
hope it helps :) Vb:
Public Function TwinsOnWay(ByVal twins As String) As String
Select Case twins
Case "Gender"
Return "Two Girls"
End Select
End Function
Thanx A LOT!!! I am going to try it! I knew the answer is easy, but you know how it goes - one always looks for the most difficult solution... Good luck with the twins... If I can't get it to work, you will hear from me again...:cool: