A1VBCode Forums

Working with forms


http://www.a1vbcode.com/vbforums/Topic32052.aspx

By marcus416 - 8/28/2013

I have three (3) forms namely: Form1, Form2 and Form3



Using Form1, I will show the Form2.

Dim FormTwo as New Form2

FormTwo.ShowDialog




Using Form1 again, I will the Form3 but the Title should be the value of TextBox1 in Form2

Dim FormThree as New Form3

FormThree.Text = Form2.TextBox1.Text 'should be like this

FormThree.ShowDialog




and when I close Form3, the Title of Form2 should be the value of TextBox1 in Form3

Form2.Title = Form3.TextBox1.Text 'something like this






What code should I write?
By Joey - 9/13/2013

I have not worked with vb.net in some time but if it's any help, in VB6 you could set the form.caption property of the textbox in the Form_Unload event of form1 to set the form title of form2.



Private Sub Form_Unload(Cancel As Integer)

Form2.Show

Form2.Caption = Form1.Text1



End Sub