"newbie" <ne****@somewhere.comwrote in message
news:3k********************************@4ax.com...
public class Form1:System.Windows.Forms.Form
{
.....
----a TextBox is created by the Designer in this area: 'textBox1'
.....
}
//==========================================
public class myExternalClass
{
.....
-----How to reach the Form1 'textBox1' from this point?
}
1) In Form1, in the properties for textBox1, change the Modifier to
"Public".
2) When you create the instance of Form1 whose textBox1 you want to
reach, save the reference to the instance that you create. For instance, if
you are creating your first copy of Form1 like this:
Form1 instanceOfForm1 = new Form1();
instanceOfForm1.Show();
then you have to keep the variable 'instanceOfForm1' because you will use
it in the next step.
3) When you want to access the textBox1 in that instance of Form1,
access it as instanceOfForm1.textBox1