Prevent window from showing in alt tab

3.7k views Asked by At

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?

2

There are 2 answers

0
Carbongrip On BEST ANSWER

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.

1
Bhavin On
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;