c# - enable a disabled button by exiting off a form inside a form -
OK, I'm doing this.
In the Start menu form, button 2- When button2 is clicked, brings a new look and is disabled Now the new look (InchMm conversion form) is up and when I'm done with that form I press the X button when it is done I want to enable Button 2 from StartMenu form. Down my code
StartMenu
Private Zero Button 2_Click (Object Sender, EventArgs e) {this.IsMdiContainer = true; InchMm_Conversion f = new InchMm_Conversion (); F.MdiParent = this; F.Show (); Button 2 Competent = valid; } Private Zero Button 3_Click (Object Sender, EventArgs e) {this.LayoutMdi (MdiLayout.ArrangeIcons); } Public Zero enableB () {button2.Enabled = true; }
InchMm conversion form
Private Zero InchMm_Closing (Object Sender, System.ComponentModel.CancelEventArgs e) {StartMenu.enableB (); }
I am getting an error that says that the object reference for non-stationary area, method, or property is required. Now I know that it should be right in the form of my face, but I am still learning a lot and I feel that I am near
I will try it
Private Zero Button 2_Click (Object Sender, EventAgds E) {This. ISMDI Container = true; InchMm_Conversion f = new InchMm_Conversion (); F.MdiParent = this; // Here the form closes the method specified here when you set an event then it is called f.FormClosed + = f_FormClosed; F.Show (); Button 2 Competent = valid; } Private Zero Button 3_Click (Object Sender, EventArgs e) {this.LayoutMdi (MdiLayout.ArrangeIcons); } // This method is executed when the form is closed f_FormClosed (Object Sender, FormClosedEventArgs e) {button2.Enabled = true; }
Comments
Post a Comment