首页 > Windows开发 > 详细

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

时间:2018-12-14 18:32:00      阅读:332      评论:0      收藏:0      [点我收藏+]

解决方案:(其中 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);

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

原文:https://www.cnblogs.com/jizhiqiliao/p/10120472.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!