Frage

Ich habe 3 Projekte von jemandem erstellt anderem.

So .. alle drei von ihnen hat form1.

Ich möchte ein neues Fenster Form wie MDI erstellen und sie als Kind stellen.

Ich kann sie nicht hinzufügen, da die Namensräume unterschiedlich sind. Ist es möglich, wie diese hinzufügen?

Coz .. Das gezeigte Beispiel ist .. fügen Sie neue Form unter dem aktuellen Projekt.

War es hilfreich?

Lösung

I don't see why this wouldn't work.

-Make sure that the IsMdiContainer property of your new Form is set to true

-Add references to the other projects

-Add this code in your new windows form (the MDI parent) (assuming WindowsFormsApplication2 is the name of one of the projects):

//Create a new instance of the MDI child form 
WindowsFormsApplication2.Form1 childForm = new WindowsFormsApplication2.Form1(); 

//Set parent form for the child window 
childForm .MdiParent=this;

//Display the child window
childForm .Show();

Repeat for your other projects.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top