Well, I don't know what the original message was (can't find it), but you
can simplify the sample by making textBox1 public instead of using a
property and accessing the TextBox directly. You really should use a
property instead though. In any case, you need a few lines to access
controls in another form.
In Form1.cs:
private Form2 otherForm;
public Form1(Form2 f)
{
otherForm = f;
}
void DoStuff()
{
otherForm.textBox1.Text = "Hello World";
}
In Form2.cs
public TextBox textBox1;
{
...
Form1 f = new Form1(this);
...
}
On Sun, 24 Oct 2004 00:19:44 -0400, Hareth <ab******@hotmail.com> wrote:
i got the idea "form.textbox.text = label.text" from vb...
i tried it in C# but it generated errors
i found a diff example from :
http://msdn.microsoft.com/library/de...ormvisualc.asp
but its too confusing for me, and i think its too much work for such an
easy
code...
anyone has an easier way?
preferably a one/two line code...instead of 5 lines in two diff forms
(check weblink I posted)..
--
Happy Coding!
Morten Wennevik [C# MVP]