Minimize the main form to System Tray at start up

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

Guest

Hi,

I know how to make my form minimize to System Tray when users press the MinimizeBox (using the NotifyIcon control). But how can I do that at application startup ? What I want to do is similar to instant messaging programs (MSN, AIM, ...) whereas the application starts at Windows startup and automatically minimize itself to System Tray.

Any help is much appreciated.

Kinh Luan
 
You can close the mainform when the Form is activated for the first time by adding a handler for the Form.Activated event. However, this event is called every time your form is activated - i.e. every time it is brought to the front, so you have to make sure that you only close the form in the Activated event handler the first time the handler is called.

Regards, Jakob.
 
Hook in to the Form_Load event and in there make a call to your method that
minimizes the form to the system tray.

HTH

John

Dotnetjunky said:
Hi,

I know how to make my form minimize to System Tray when users press the
MinimizeBox (using the NotifyIcon control). But how can I do that at
application startup ? What I want to do is similar to instant messaging
programs (MSN, AIM, ...) whereas the application starts at Windows startup
and automatically minimize itself to System Tray.
 
* "=?Utf-8?B?RG90bmV0anVua3k=?= said:
I know how to make my form minimize to System Tray when users press
the MinimizeBox (using the NotifyIcon control). But how can I do that at
application startup ? What I want to do is similar to instant messaging
programs (MSN, AIM, ...) whereas the application starts at Windows
startup and automatically minimize itself to System Tray.

<URL:http://www.google.de/groups?as_q=dotnet+minimze+to+tray>
 
Hey John,

I tried minimizing in the Form.Load event but it did not work. My attempt was completely ignored and the form popped up on the screen :-)

Regards, Jakob.
 
Back
Top