当前位置

首页 > 互联网 > 计算机 > 计算机硬件 > C#实现将窗体固定在显示器的左上角且不能移动的办法

C#实现将窗体固定在显示器的左上角且不能移动的办法

推荐人: 来源: 文萃屋 阅读: 3.05W 次

本文实例讲述了C#实现将窗体固定在显示器的.左上角且不能移动的方法。分享给大家供大家参考。具体实现方法如下:

C#实现将窗体固定在显示器的左上角且不能移动的办法

using System;using ric;using onentModel;using ;using ing;using ;using ;using s;using ;using ropServices;namespace App{ public partial class Form4 : Form { public Form4() { InitializeComponent(); tPosition = al; tion = new Point(0, 0); } protected override void WndProc(ref Message m) { roc(ref m); if ( == 0x84 && lt == (IntPtr)2) //不让拖动标题栏 { lt = (IntPtr)1; } if ( == 0xA3) //双击标题栏无反应 { am = ; } } }}

希望本文所述对大家的C#程序设计有所帮助。