當前位置:學者齋 >

計算機 >計算機硬件 >

C#實現將窗體固定在顯示器的左上角且不能移動的辦法

C#實現將窗體固定在顯示器的左上角且不能移動的辦法

本文實例講述了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#程序設計有所幫助。

  • 文章版權屬於文章作者所有,轉載請註明 https://xuezhezhai.com/zh-hk/jsj/yingjian/rdvjxk.html