How to minimize whole application (all its forms)?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have the following problem with application minimizing . I spent
hours with searching for solution but no success.

I have a main form on which I show modal form using Form.ShowDialog method.
I want to achieve this behaviour: After the user clicks on the minimize
button of modal form, the whole application should minimize to the taskbar
(both main window and modal dialog should be hidden). After restore, windows
should be in original state - active modal form above main form.
 
Pozi,

This is eaisier than you may expect. There two overloads of the ShowDialog
methods. You need to use the one that accepts parameter and pass there
reference to the main from. This way the main form becomes owner of the
dialog and will minimize/maximize along as well as the dialog will be always
on top.

You should probably remove the dialog from the taskbar by setting
ShowInTaskbar to false.
 
Back
Top