Re: Total Newb to VB .Net
Quote:
Originally posted by cooldude4u2no
Ok i have just recently upgraded from vb6 to vb .net 2003. And I had no idea the coding was going to be this much different. So the problem i ran into is this:
Lets Say i have two forms (Form1 and Form2) Each with a textbox(TextBox1) on each. When i change Form2.textbox1.text i want form1.textbox1.text to change to form2.texbox1.text.
Example Code i Have In form 2:
VB Code:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim form1 As Form1
form1.TextBox1.Text = Me.TextBox1.Text
End Sub
But when i run this it generates an error.. What do i do? Im a newb at VB .Net and it all seems so different to me than vb6.
Thanks,
Cooldude4u2no
If you search this forum you will find many threads on this. There are several ways to do it and it depends on what you want to achieve.
Which form do you want to use to start the project?
Do you want to close either or both forms while the project is running?
If you altered your above code line to
Dim form1 as New Form1 (but preferably Dim frm1 as New form1)
then it would work, but how did you create an instance of form2???