I'm trying to invoke button from a different Form than it was created. I have application with two forms:
- Main
- Second
The "Second" Form is invoked from the "Main" Form with the code:
Second run_second_form = new Second();
run_second_form.Show();
On the "Main" Form I have a button "Button1". Is it possible this button to be invoked from the "Second" Form?
I can easily invoke "Button1" from the "Main" Form where it is created, with the code:
Button1.PerformClick();
but I'm not able to do it from the "Second" Form. I tried with:
Main.Button1.PerformClick();
but it says "The name "Button1" does not exists in the current context".
