Eneble/disable button via class
In the main form, the button is disable that, after fulfilling the conditions in the external class must activate the button. can you help me? Thanks so much for all the advice. Mark
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Aug 6, 2011, 4:13 AM EDT
Form1 f1 = (Form1)Application.OpenForms["Form1"];
Button b1 = (Button)f1.Controls["button1"];
b1.Enabled = true;
mark Adamek4 reputationPosted Aug 6, 2011, 4:45 AM EDT
main_form f1 = (main_form) Application.OpenForms ["main_form"];
f1.button.Enabled = false;
Vilas GiteRank #951 · 2.1K reputationPosted Aug 6, 2011, 5:42 AM EDT
Form1 f1 = new Form1();
button1.Enabled = false;
For more details about Windows Controls in C#:
http://www.c-sharpcorner.com/1/77/
---------------------------------------------------VulpesRank #55 · 29.2K reputationPosted Aug 6, 2011, 7:04 AM EDT
Your first line would create a new instance of Form1 rather than accessing the existing instance.