Passing things from Form1 to Form2 and back
Hi everyone !
Imagine this :
I have 2 Forms: Form1 and Form2
Form1 is the startupform and holds a button, Button1 , to show Form 2.
Code:
Dim F2AsNew Form2PrivateSub Button1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Button1.ClickF2.Show()
EndSubOn Button1_Click an new Form2 is shown.
Form2 holds a button wich should change the text of Form1:
Code:
Dim
F1As Form1PrivateSub Button1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Button1.ClickF1.Text = "hello"
EndSubThis gives the result : Object reference not set to an instance of an object.
I know i'm doing somthing wrong, but i've just switched from VB6 to .net, and it's all new to me now :-(
Can someone please tell me how i should do this ?
Kind regards,
Guy

