Why doesn't it work? (C# Visual Studio 2008)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
764 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 26, 2009

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.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • 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";

  • 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());

  • try making form1 as a child of form2 so it can access his controls properties, may not be it but trying never hurts.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more