I have 2 forms: Form1 and Form2.
In Form1 I open Form2 in a new Thread by clicking on Button1.
I want to set the title of Form2 but I have no Idea how and whetever it is possible. Here is the code from Form1 , Form2 is just an empty Form:
Public Class Form1
Dim TH As New Threading.Thread(AddressOf FormShow)
Private Shared Sub FormShow()
Dim FF As New Form2
FF.Show()
Do While FF.Visible
Threading.Thread.Sleep(100)
Application.DoEvents()
Loop
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TH.Start()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'How to change the Form2 title?
'I need something like : TH.Form2.Text="NewTitle"?
End Sub
End Class
If I start the code and click on Button1 Form2 will open. But how can I change the window title in Form2 when I press Button2 on Form1? Any ideas? Thanks.