First you need to make sure that text1's access modifier is set to public
(Public text1 As TextBox). After you do that, Form2 just needs to have a
reference to form1 somehow. There's a few different ways they could be
related.
If Form2 is a child of form1 (code goes in Form2):
Dim myForm1 As Form1 = Me.Parent
myForm1.TextBox1.Text = "Hi from form 2!"
If Form2 is owned by form1 (code goes in Form2):
Dim myForm1 As Form1 = Me.Owner
myForm1.TextBox1.Text = "Hi from form 2!"
You can create a property on Form2 like this:
Private _myForm As Form1
Public Property MyForm() As Form1
Get
MyForm = _myForm
End Get
Set(ByVal Value As Form1)
_myForm = Value
End Set
End Property
Then you just need to make sure you set that property before you try to
access it.
Good luck!
"Wooten26" <wo******@nospam-yahoo.com> wrote in message
news:17****************************@phx.gbl...
Ok.. extremly new to NET so bear with me )
In VB5 you could do this
(in Form2)
form1.text1.text = "test"
now how do you change textbox propertys from another part
of code - like from a module or another form?
Thanks-
Noramn