Home All Groups Group Topic Archive Search About

How to tell when a form is minimizing or closing!

Author
17 Mar 2006 8:41 PM
Tony Clark
Hi,

How can i tell when a form is minimizing or closing by use of the button in
the top right of the form?

thanks in advance

Author
17 Mar 2006 9:50 PM
Andy
Attach an event handler to the appropiate form event.
Are all your drivers up to date? click for free checkup

Author
17 Mar 2006 10:03 PM
Tony Clark
thanks,

whats the event called?


Show quoteHide quote
"Andy" <ajj3***@alum.rit.edu> wrote in message
news:1142632240.442030.125260@e56g2000cwe.googlegroups.com...
> Attach an event handler to the appropiate form event.
>
Author
17 Mar 2006 10:07 PM
Tony Clark
ok i got FormClosing event, but i cant see one for minimizing?

also is there a way, when the form is closing, of actually stopping it and
just hiding it, i want to have a notify icon, and when the form is closed
(so to speak) it just hides itself until the icon in the systray is clicked.

thanks



Show quoteHide quote
"Tony Clark" <T***@here.com> wrote in message
news:uFBOf6gSGHA.1236@TK2MSFTNGP11.phx.gbl...
> thanks,
>
> whats the event called?
>
>
> "Andy" <ajj3***@alum.rit.edu> wrote in message
> news:1142632240.442030.125260@e56g2000cwe.googlegroups.com...
>> Attach an event handler to the appropiate form event.
>>
>
>
Author
17 Mar 2006 10:49 PM
Chris Dunaway
In the FormClosing event you can do this:

        private void Form1_FormClosing(object sender,
FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }

The e.CloseReason property will also tell you if the form is closing by
the x button or some other reason.

Bookmark and Share