Cann't Hide Main Form Window

  • Thread starter Thread starter cok
  • Start date Start date
C

cok

Hi ,All

I have a small c# app, when It start, Hide it self to system tray.

but when I add:

public Form1()
{
InitializeComponent();
Hide();
}
or
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Hide();
}

they doesn't work,
How can I do ?,
thanks


--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/
_/ Nie Longhai , coder -_-|||
_/ Shanghai Xomi Instruments Co., Ltd.
_/ URL: http://www.xomi.cn
_/ Shanghai C&U Industrial Park
_/ Feng Cheng Town, Feng Xian District
_/ Shanghai, 201411
_/ Phone:86-21-57513966-807
_/ Fax:86-21-57513636
_/ Mobile:13162055440
_/ Email:[email protected] ,[email protected]
_/
_/ Profession & Focus
_/ High precision semiconductor metrology system vendor.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
Hi cok,

Try the following:

1.) Add a NotifyIcon component to your form and assign it a proper icon
to display in the system tray.

2.) Add a "click" handler to the NotifyIcon instance and set the
"WindowState" Form's WindowState property to FormWindowState.Normal (or
whatever your pleasure).

3.) In the Form's load event make sure the NotifyIcon instance's
visibility is set to true.

4.) In the Form's load event make sure the Form's ShowInTaskbar
property is set to false.

5.) In the Form's load event, call Hide().

I hope this helps. Please let me know if there is something more
specific you were looking for.

Regards,

Geoff
http://nonspect.com
 
Back
Top