1

I am working on a program where I don't want a window to show in alt tab menu. However I need the window style to be borderless. All the solutions I have found say to change the border to tool but that won't work when I need the window to be borderless. Anyone have ideas?

JYelton
  • 35,664
  • 27
  • 132
  • 191
Carbongrip
  • 173
  • 1
  • 3
  • 12

2 Answers2

3

I followed the link, had to scroll down. The answer is to use this code on the forms class:

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        // turn on WS_EX_TOOLWINDOW style bit
        cp.ExStyle |= 0x80;
        return cp;
    }
}

Also see this link for more info.

JYelton
  • 35,664
  • 27
  • 132
  • 191
Carbongrip
  • 173
  • 1
  • 3
  • 12
0
this.ShowInTaskbar = false;

yourform.ShowInTaskbar = false;// In Properties Window or write this in form load event

You must also set the FormBorderStyle

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
Carbongrip
  • 173
  • 1
  • 3
  • 12
Bhavin
  • 240
  • 7
  • 19