- 相關(guān)推薦
C#實(shí)現(xiàn)將窗體固定在顯示器的左上角且不能移動(dòng)的辦法
本文實(shí)例講述了C#實(shí)現(xiàn)將窗體固定在顯示器的左上角且不能移動(dòng)的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Runtime.InteropServices;namespace App{ public partial class Form4 : Form { public Form4() { InitializeComponent(); this.StartPosition = FormStartPosition.Manual; this.Location = new Point(0, 0); } protected override void WndProc(ref Message m) { base.WndProc(ref m); if (m.Msg == 0x84 && m.Result == (IntPtr)2) //不讓拖動(dòng)標(biāo)題欄 { m.Result = (IntPtr)1; } if (m.Msg == 0xA3) //雙擊標(biāo)題欄無(wú)反應(yīng) { m.WParam = System.IntPtr.Zero; } } }}
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
【C#實(shí)現(xiàn)將窗體固定在顯示器的左上角且不能移動(dòng)的辦法】相關(guān)文章:
不能打開(kāi)網(wǎng)頁(yè)的解決辦法04-13
如何用C#制作氣泡屏幕保護(hù)07-19
顯示器的維護(hù)方法06-29
顯示器畫(huà)面失真的原因04-04
液晶顯示器保養(yǎng)技巧07-16
設(shè)置雙顯示器顯示的方法11-17
電腦顯示器無(wú)輸入信號(hào)02-21
顯示器選購(gòu)時(shí)的注意事項(xiàng)09-04
CRT顯示器什么是分辨率03-17