YourSurrogateGod
July 25th, 2005, 03:41 PM
Ok, I have 2 forms. Form1 creates Form2. My question is, how can I pass information between the two of them? For example, if I had a DB connection object that needed to be passed from one to the other, how can I pass that object? Or any other object for that matter...
Public Class Form1
Inherits System.Windows.Forms.Form
Dim new_form As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
new_form.Show()
End Sub
End Class
Public Class Form2
Inherits System.Windows.Forms.Form
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
End Sub
End Class
Public Class Form1
Inherits System.Windows.Forms.Form
Dim new_form As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
new_form.Show()
End Sub
End Class
Public Class Form2
Inherits System.Windows.Forms.Form
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
End Sub
End Class