Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Can we add different applications to MDI??
Here is the screen shot of my MDI form.

http://img267.imageshack.us/img267/5222/mdiv.jpg[^]

I have created multiple applications before and now I want to add them to this MDI. So how to add them? Do I have to import all projects to my MDI project? I am new to MDI.

Hope my question is clear.
Posted
Comments
Sergey Alexandrovich Kryukov 15-Feb-13 0:30am    
Why? why?!
—SA

1 solution

First of all, the question makes no sense. There is no such thing as "add application to an application".

If you simply mean that you want to run an application (start a child process), you can do it, but what are you going to do with it? Processes are very well isolated. If they are not intentionally designed for some collaboration, you cannot do much about it. Trying to do such things is not recommended. Even though you can insert a main window of child application (when and if it appears) in some of your forms, this is a dirty trick which will makes the situation even worse. It works with Windows only because its legacy functionality inherited from old Windows versions when Windows was not an OS yet. If will run inside some host form, with all its non-client areas, which, in turn, will brake all the acceptable UI styles; and you still won't have a real control over the application. Don't even think about it.

However, if the child application is a console-only application, you can pretty easily redirect StandardOutput and show the results in your form. The idea is apparent from this MDSN help page, with a code sample:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx[^].

Now, about your MDI…

Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
How to Create MDI Parent Window in WPF?[^].

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF? [Solution 2],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

—SA
 
Share this answer
 
v2
Comments
SweetHoneyBee 15-Feb-13 0:43am    
I just wanted to integrate all my applications to look better and I thought MDI will do it.
Btw thanks for your suggestion.
Sergey Alexandrovich Kryukov 15-Feb-13 0:51am    
First part of my answer explains that it won't be the integration. Sorry.
The second part should tell you that nothing can "look better" with MDI. I explained much nicer alternatives.

But it wasn't a suggestion. Do you have source code of those child applications or do you develop them? If so, I could probably suggest how to integrate them, if not: it would be a bad idea to get into it at all.

—SA

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