berserk.org

berserk.org header image

C# How to make a window not show up in the taskbar

October 7th, 2004 · No Comments

This is sort of hard to find, so I figure I’d post it.

Let’s say you have a windows application in C# and you want to do the whole notify icon thing. Here’s a trick so when you minimize your window, it doesn’t show up in the taskbar.

protected override void OnResize(EventArgs e)
{
    if ( this.WindowState == FormWindowState.Minimized)
        this.Hide();
    base.OnResize(e);
}

private void notifyIcon_DoubleClick(object sender, System.EventArgs e)
{
    this.Show();
    this.WindowState = FormWindowState.Normal;
    this.Visible = true;
    this.Focus();
    this.BringToFront();

}

Tags: code

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment