W
Wayne Taylor
Hello all.....
I'm having a hard time understanding how to read/write to the contents of controls on diffient forms.
If I create a Windows Form project with two forms..... add a text box to each...now I add the following code to form1.....
Public Class Form1
Inherits System.Windows.Forms.Form
Dim f2 As New Form2
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f2.Show()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
f2.TextBox1.Text = TextBox1.Text
End Sub
End Class
So when you run the app, what ever you type in form1, textbox1's control will appear in form2, textbox1 control....
What I can't do is make it so that what's typed in form2, textbox1 appears in form1, textbox1....
This is only practice code, I don't want to do this in live project, I'm just trying to get my head around it.....
Thanks in advance, hope that makes sense.
Wayne Taylor (kryptos)
If you wish to e-mail me, then please remove 'online' from my e-mail addy.
I'm having a hard time understanding how to read/write to the contents of controls on diffient forms.
If I create a Windows Form project with two forms..... add a text box to each...now I add the following code to form1.....
Public Class Form1
Inherits System.Windows.Forms.Form
Dim f2 As New Form2
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f2.Show()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
f2.TextBox1.Text = TextBox1.Text
End Sub
End Class
So when you run the app, what ever you type in form1, textbox1's control will appear in form2, textbox1 control....
What I can't do is make it so that what's typed in form2, textbox1 appears in form1, textbox1....
This is only practice code, I don't want to do this in live project, I'm just trying to get my head around it.....
Thanks in advance, hope that makes sense.
Wayne Taylor (kryptos)
If you wish to e-mail me, then please remove 'online' from my e-mail addy.