I made a simple application to demonstrate my problem. Is there someone who could help me with this problem? The text in the other window is not changing, what sould I
do to make it work?
add &fmt=18 to the web address to see the video in higher resolution.
Found out how to make it work:
Use this in your Button_Click on Form2:
FormCollection fc = Application.OpenForms;
Form1 fg = (Form1)fc["Form1"];
Control.ControlCollection cc = fg.Controls;
TextBox t1 = (TextBox)cc["textBox1"];
t1.Text = "something";
1129Irving 2 years ago
I know why it isn't working but don't know how to get it to work.
The reason it is not working is because you create 2 Form1's. The Program.cs file is creating 1 and you are creating 1 too. The Form1 you see on the screen is not the Form1 you are creating int the class C11 but the one created by default in Program.cs. Somehow you need access to the Form1 created in the statement:
Application.Run(new Form1());
1129Irving 2 years ago
try making form1 as a child of form2 so it can access his controls properties, may not be it but trying never hurts.
DevilRaider 2 years ago