How to minimize whole application (all its forms)?

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.
 
S

Stoitcho Goutsev \(100\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top