Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have windows application which will start up other process for processing some tasks, till that time the application will be maximized but inactive as expected. But i need to minimize the application on to taskbar, and after the processing completes maximize the same application. Application has an MDI from 1 child form. I want to trigger the minimizing mechanism from Child form..


Please help
Veer
Posted

C#
Parent.WindowState = FormWindowState.Minimized;


and

C#
Parent.WindowState = FormWindowState.Maximized;
 
Share this answer
 
Couple of bad ideas here. First, don't minimize or hide the window. Instead, perform your lengthy operation is a separate thread and leave you UI accessible, visible and responsive, only disable some controls.

Secondly, who needs MDI? Don't torture yourself and scare 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. I can explain what to do instead. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to Create MDI Parent Window in WPF?[^],
How to set child forms maximized, last childform minimized[^].

As to the threading with UI, please see my past answers:
http://www.codeproject.com/Answers/159125/Control-Invoke-vs-Control-BeginInvoke#answer1[^],
Problem with Treeview Scanner And MD5[^].

—SA
 
Share this answer
 
v2

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