C#实现让窗体永远在窗体最前面显示的实例
本文以实例描述了C#实现让窗体永远在窗体最前面显示的方法,具体步骤如下:
1、新建一个窗体程序,添加一个Timer以及设置它可用并绑定事件。
2、设置窗体的TopMost属性为True
3、然后设置代码如下即可实现.
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;namespacejiyi
{
publicpartialclassForm1:Form
{publicForm1()
{
InitializeComponent();
}
privatevoidForm1_Load(objectsender,EventArgse)
{
}
privatevoidtimer1_Tick(objectsender,EventArgse)
{
this.TopMost=false;
this.BringToFront();
this.TopMost=true;
}
}
}热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短