保持窗口始终显示在屏幕(即便Win+D返回桌面)

解决方案:(其中 TopMost = true 便可使窗口保持最前端)

public mainFormHandler()
{
    InitializeComponent();
    // set TopMost
    this.TopMost = true;
}

private void mainFormHandler_SizeChanged(object sender, EventArgs e)
{
    if (this.WindowState == FormWindowState.Minimized)
    {
        this.WindowState = FormWindowState.Normal;
    }
    SetParent(this.Handle.ToInt32(), this.Handle.ToInt32());
}
[DllImport(
"user32.dll", EntryPoint = "SetParent")] public static extern int SetParent(int hWndChild, int hWndNewParent);
原文地址:https://www.cnblogs.com/jizhiqiliao/p/10120472.html