Hi,
I'm just starting my way in C# and I have this question/problem:
I've created a "Windows form" project with several forms, where Form1 is
the main form and it is also has a statusStrip control. I've managed to
change the text in it with a method in Form1, but I can't manage to get
access to that method from other forms so I could update it from them.
How can I get access to that method from the other forms? Are there
other ways to control the statusstrip in form1 from the other forms?
Thanks,
Udi Goldstein
Loading
Udi GoldsteinPosted Jul 20, 2010, 1:56 PM
Sam HobbsPosted Jul 20, 2010, 1:00 PM
There are many ways to solve the problem. You can create a member variable in the other forms and set the value of the member variables to the main form, so the other forms can use the member variable to call the function in the main form. Or you could use something such as the following to get the main form (where Form1 is the name of your main form class):
Udi GoldsteinPosted Jul 20, 2010, 12:12 PM
I was able to get to the method from other forms, by creating a new Form1 object,
But it's just won't write to the statusbar by doing so...
Sam HobbsPosted Jul 20, 2010, 11:51 AM
Is the method public?