使程序始终在最前

本文介绍了一种在Windows窗体应用程序中使窗体始终位于其他窗口上方的方法。通过设置`TopMost`属性为`true`,可以使Form1实例始终保持在最上层,确保其在用户操作其他程序时仍可见。
 1ExpandedBlockStart.gifContractedBlock.gif/**//// <summary>
 2InBlock.gif        /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 3InBlock.gif        /// 此方法的内容。
 4ExpandedBlockEnd.gif        /// </summary>

 5None.gif        private void InitializeComponent()
 6ExpandedBlockStart.gifContractedBlock.gif        dot.gif{
 7InBlock.gif            // 
 8InBlock.gif            // Form1
 9InBlock.gif            // 
10InBlock.gif            this.AutoScaleBaseSize = new System.Drawing.Size(614);
11InBlock.gif            this.ClientSize = new System.Drawing.Size(216165);
12InBlock.gif            this.Name = "Form1";
13InBlock.gif            this.Text = "Form1";
14InBlock.gif
15InBlock.gif            //设置此属性即可
16InBlock.gif            this.TopMost = true;
17ExpandedBlockEnd.gif        }

转载于:https://www.cnblogs.com/zixin/archive/2006/06/13/424829.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值