C#实现让窗体永远在窗体最前面显示的实例
发布时间:2020-12-15 05:59:45 所属栏目:百科 来源:网络整理
导读:本文以实例描述了C#实现让窗体永远在窗体最前面显示的方法,具体步骤如下: 1、新建一个窗体程序,添加一个Timer以及设置它可用并绑定事件。 2、设置窗体的TopMost属性为True 3、然后设置代码如下即可实现. using System;using System.Collections.Generic;u
本文以实例描述了C#实现让窗体永远在窗体最前面显示的方法,具体步骤如下: 1、新建一个窗体程序,添加一个Timer以及设置它可用并绑定事件。 2、设置窗体的TopMost属性为True 3、然后设置代码如下即可实现. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;namespace jiyi { public partial class Form1 : Form {public Form1() { InitializeComponent(); } private void Form1_Load(object sender,EventArgs e) { } private void timer1_Tick(object sender,EventArgs e) { this.TopMost = false; this.BringToFront(); this.TopMost = true; } } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |