Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, i have a windows form application and i have an initial form wich is the container of the other forms.
I want to pass from Form1 (mdichild form) to another Form2 (mdichild form).
My code is working if i am in the initial form but if i am in the form1 and want to pass to form2 nothing is happening !!
Please any help :)

What I have tried:

if (Wizard_C9_V.SelectedPage == wizardCompletionPage1)
            {
                /*this.Hide();
                FormInitial fmi = new FormInitial();
                fmi.IsMdiContainer = true;
                fcp.MdiParent = fmi;
                fcp.Show();*/              

            }
Posted
Updated 18-Jan-21 3:15am

 
Share this answer
 
As per my understanding you want to add child screen from another child screen.
For example -
MDIParentForm > open first child > on first child open 2nd child screen and add this screen to MDIParentForm.

MDIParentForm = Parent container.
Form2 - First child screen
Form3 - Second child screen

Add below code to your second child form from where you want to open and add screen to MDIParent form.

C#
Form3 objFrom3 = new Form3();
objFrom3.MdiParent = Application.OpenForms["MdiForm1"];
objFrom3.Show();

If you need more help then let me know.
 
Share this answer
 
Comments
houssem eddine ayari 19-Jan-21 2:46am    
@Chander Parkash Mourya thanks. It realy was helpfull and thanks to you i just deploied my application :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900