C# winfrom 程序窗口不显示在任务栏及alt+tab不显示
作者:互联网
C# winform 程序窗口不显示在任务栏及alt+tab不显示
1.winform窗口不显示在任务栏
this.ShowInTaskbar = false;
2.winform窗口alt+tab不显示
/// <summary>
/// 让程序不显示在alt+Tab视图窗体中
/// </summary>
protected override CreateParams CreateParams
{
get
{
const int WS_EX_APPWINDOW = 0x40000;
const int WS_EX_TOOLWINDOW = 0x80;
CreateParams cp = base.CreateParams;
cp.ExStyle &= (~WS_EX_APPWINDOW);
cp.ExStyle |= WS_EX_TOOLWINDOW;
return cp;
}
}
标签:C#,winfrom,CreateParams,WS,EX,tab,alt,cp 来源: https://www.cnblogs.com/darkic/p/16256294.html