C#如何让一个WINDOWS窗体一直显示在最前面,不被覆盖
怎么让一个WINDOWS窗体一直显示在最前面,不会因为点击别的窗体而隐藏这个窗体, topmost=true也不好使
------解决方案--------------------http://topic.csdn.net/t/20060811/15/4943201.html
------解决方案--------------------设置topmost应该就好用了,刚解决这个问题。
------解决方案--------------------
------解决方案-------------------- [System.Runtime.InteropServices.DllImport("user32.dll")]
static extern bool SetForegroundWindow(IntPtr hWnd);
private void Form1_Load(object sender, EventArgs e)
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.ShowInTaskbar = false;
this.TopMost = true;
this.timer1.Interval = 1;
this.timer1.Enabled = true;
this.WindowState = FormWindowState.Maximized;
}
private void timer1_Tick(object sender, EventArgs e)
{
SetForegroundWindow(this.Handle);
}