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 生日果酒祝福语简短独特
18 公司商务中秋祝福语简短