通过钩子,用快捷键激活窗体,实现窗体显示在用户界面的前台。
if (this.WindowState == FormWindowState.Normal || this.WindowState == FormWindowState.Maximized)
{
this.Activate();
}
else
{
// 窗体处在最小化状态
this.WindowState = FormWindowState.Normal;
this.Focus();
this.Activate();
}



