Hello Michael,
While I agree with you he could have googled first, I'm afraid you misread
gogs' question, he was asking about windows forms, not ASP.NET.
Answer to gogs' question:
Keep in mind that forms are still objects. You can have multiple instances
of a particular form class and changing properties of one won't affect other
instances.
You will need to pass a reference to an instance of Form1 to Form2 (either
in constructor or by using a property), make sure the TextBox you need to
change is visible (public or internal) and change it's Text property as you
wanted to do in the example you've posted.
class Form2 : System.Windows.Forms.Form
{
private Form1 form1;
public Form2(Form1 form1)
{
this.form1 = form1;
//InitializeComponents(); or whatever you have in your constructor
}
void DoSomethingToForm1()
{
this.form1.textBox1.Text = "Foo";
}
}
"Michael Nemtsev" <ne*****@msn.comwrote in message
news:a2***************************@msnews.microsof t.com...
Hello gogs,
Try to use google before asking :)
http://groups.google.com/groups/sear...+between+pages
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
gHEEEELLLLLPP
ggI hawe two Open form... Form1 and Form2
ggHow I can from Form2 send text to textbox of Form1
gg//public System.Windows.Forms.TextBox textBox1;
g//Form1 fo = new Form1();
g//fo.textbox1.Text = "something";
g--Don't work