Home > Net > In c # how to minimizing the child form independent
In c # how to minimizing the child form independent
Time:10-18
I set up A main Form, the main Form is set above the function of each module, each function module is A child Form, child Form A of the Form through the new Form shows A child Form B, I minimize the Form B, Form A and follow all minimize the main Form, very upset about it, would you please tell me what the method you Daniel, minimize the Form B just minimize the oneself, to minimize the task bar then click can restore again, ask the great spirit action ah, thank you
CodePudding user response:
I don't use local VS2015 LZ said this problem, this is my local code
//Form1. Cs: Private void Form1_Load (object sender, EventArgs e) { FormA fa=new FormA (); Fa. MdiParent=this; Fa. The Show (); } Private void InitializeComponent () { Enclosing SuspendLayout (); // //Form1 // Enclosing AutoScaleDimensions=new System. Drawing. SizeF (6 f, 12 f); Enclosing AutoScaleMode=System. Windows. Forms. AutoScaleMode. The Font; Enclosing ClientSize=new System. Drawing. The Size (554, 351); Enclosing IsMdiContainer=true; This. Name="Form1"; This. The Text="Form1"; Enclosing the Load +=new System. EventHandler (enclosing the Form1_Load); Enclosing ResumeLayout (false); } //FormA. Cs: Private void button1_Click (object sender, EventArgs e) { FormB fb=new FormB (); Fb. MdiParent=MdiParent; Fb. The Show (); }
CodePudding user response:
Added to the second method is the system automatically generated, I just put the main form of IsMdiContainer attribute set to true
CodePudding user response:
Your way is much document form on the second floor
CodePudding user response:
Your code has a problem, child form the default will only shut down, according to the main form closed won't appear what you said at the same time to minimize the situation