Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f2 As New Form2
f2.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
For Each frm As Form In Application.OpenForms
If TypeOf frm Is Form2 Then
Dim f2 As Form2 = CType(frm, Form2)
f2.TextBox1.Text = "Testing..."
End If
Next
End Sub
End Class
|