Link to home
Start Free TrialLog in
Avatar of sdom100
sdom100

asked on

Minimise to taskbar (WM6)

Hi,
I need my application to minimise to the taskbar, showing an icon - just like the native volume control does.
Could someone please provide me some c# code to do this please.

Thanks.
S.
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

If you're using Visual Studio .NET, add a NotifyIcon to your form. Set the default Visible property to be false.

Add a Form_Resize event handler to the form.

private void Form1_Resize(object sender, System.EventArgs e)
{
      if(this.WindowState == FormWindowState.Minimized)
      {
            this.Visible = false;
            notifyIcon1.Visible = true;
      }
}

Then add an event handler to the NotifyIcon (usually double click) with this code:

this.Visible = true;
notifyIcon1.Visible = false;
Placing Your C# Application in the System Tray
http://www.codeguru.com/Csharp/.NET/net_general/tipstricks/article.php/c6933/

C# Tip: Placing Your C# Application in the System Tray
http://www.developer.com/net/csharp/article.php/3336751
Avatar of sdom100
sdom100

ASKER

Thanks but unfortunately on Windows Mobile 6, there is no notify icon.
The closest it gets is a notification bubble but that's not quite the same.
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sdom100

ASKER

The article in Dhaest's answer does not put an icon on the taskbar but this is apparently banned in CE (officially anyway). The article is about as close as useful info gets to the answer - although it didnt work when I tried it :(