• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1830
  • Last Modified:

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.
0
sdom100
Asked:
sdom100
  • 3
  • 2
1 Solution
 
DhaestCommented:
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;
0
 
DhaestCommented:
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
0
 
sdom100Author Commented:
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.
0
 
DhaestCommented:
Using the Microsoft .NET Compact Framework MessageWindow Class
http://msdn.microsoft.com/en-us/library/aa446525.aspx

Learn how to use the .NET Compact Framework MessageWindow class to create a NotifyIcon. (9 printed pages)
0
 
sdom100Author Commented:
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 :(
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now