国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > C# > 正文

C#實(shí)現(xiàn)將窗體固定在顯示器的左上角且不能移動(dòng)的方法

2020-01-24 01:30:12
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎ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ì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 曲水县| 元谋县| 龙州县| 永泰县| 浦北县| 佛教| 肥城市| 古田县| 乌什县| 广昌县| 秦安县| 西乌珠穆沁旗| 肇源县| 红河县| 临夏市| 新河县| 彩票| 平远县| 兰考县| 肇州县| 巫溪县| 永修县| 大厂| 徐汇区| 马龙县| 安宁市| 吴川市| 乌鲁木齐市| 理塘县| 微博| 运城市| 方山县| 兴安盟| 大丰市| 海阳市| 安国市| 湟源县| 汾阳市| 南川市| 定结县| 长宁区|