3xodus
Freshman
*sigh* I'm almost embarrased to ask. This is in C# for Visual Studio 2005 by the way.
I've spent a few hours last night and literally *hours* trying to figure this out today, and can't for the life of me get it to work.
There's a fair amount of threads on this already, but the majority deal with accessing controls on Form2 from Form1, which I can do fine. What I'm having problems with is accessing properties on Form1 from Form2.
That first thing I thought was just:
But it dosent work, and as I understand it the reason it dosent work is that I've created another instance of Form1 and I'm accessing *that*, not the existing one.
The only other solutions I've found were for VB .NET and involved adding code to the 'constructor'. I couldn't find any information about how to get this to work for C#, is that what I should be looking for?
Any help appreciated, thankyou
I've spent a few hours last night and literally *hours* trying to figure this out today, and can't for the life of me get it to work.
There's a fair amount of threads on this already, but the majority deal with accessing controls on Form2 from Form1, which I can do fine. What I'm having problems with is accessing properties on Form1 from Form2.
That first thing I thought was just:
C#:
Form1 firstform = new Form1();
firstForm.txtBox.Text = "test";
The only other solutions I've found were for VB .NET and involved adding code to the 'constructor'. I couldn't find any information about how to get this to work for C#, is that what I should be looking for?
Any help appreciated, thankyou