"Peter Somos" <ms...@multisoft.hu> wrote in message
news:etIDUWE1CHA.1840@TK2MSFTNGP12...
> Hi!
>
> If I open a modal window from the main form of the application and I
> minimize the main form, the open modal dialog is closed. In attached
sampe,
> press 'Open Form2' and 'Minimize MainForm'. Form2 is closed when main
form
> (Form1) is minimized.
>
> TIA,
> Peter Somos
>
>
>
In your first version, Minimize1, change this:
private void button1_Click(object sender, System.EventArgs e)
{
this.WindowState=FormWindowState.Minimized;
}
OR
Get rid of the button and set "MinimizeBox" to true.
When you minimize a DialogBox, the parent form is automatically
minimized with it. You don't need to program that in. In other words,
you're trying to program in what already exists.
Chris A. R.
"Miklos Trojak" <tro...@multisoft.hu> wrote in message
news:#IpiRhl1...@TK2MSFTNGP11.phx.gbl...
> Our problem here is that forcing the application's main form to
minimized
> state from our code closes the dialog box. We want to see something
that's
> the exact copy of pressing the 'Show desktop' button on the Explorer
> shortcut bar (or choosing 'Minimize all windows' in the Taskbar's
context
> menu). I finally found the solution, but it's no way straightforward
and
> needed a lot of try and fail effort.
> Code attached (change the attachment's extension to zip...).
> We don't think it should be this complicated and ugly.
>
> Best,
> Miki
>
> "Chris A R" <sot...@bellsouth.net> wrote in message
> news:eXkpVRL1...@TK2MSFTNGP11.phx.gbl...
Best,
Miki
"Chris A R" <sot...@bellsouth.net> wrote in message
news:ehLOjwp1CHA.1180@TK2MSFTNGP12...