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

首頁 > 編程 > C# > 正文

C#非矩形窗體實現方法

2020-01-24 01:45:49
字體:
來源:轉載
供稿:網友

本文實例講述了C#非矩形窗體實現方法。分享給大家供大家參考。具體實現方法如下:

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Drawing2D;namespace WindowsApplication1{  public partial class Form3 : Form  {    Point downPoint = Point.Empty;    public Form3()    {      InitializeComponent();    }    void Set()    {      Rectangle rect = this.ClientRectangle;      using (GraphicsPath path = new GraphicsPath())      {        path.AddEllipse(rect);        this.Region = new Region(path);      }    }    private void Form3_Load(object sender, EventArgs e)    {      Set();    }    private void Form3_MouseDown(object sender, MouseEventArgs e)    {      if (e.Button != MouseButtons.Left) return;      downPoint = new Point(e.X, e.Y);    }    private void Form3_MouseMove(object sender, MouseEventArgs e)    {      if (downPoint == Point.Empty) return;      Point location = new Point(this.Left + e.X - downPoint.X, this.Top + e.Y - downPoint.Y);      this.Location = location;    }    private void Form3_MouseUp(object sender, MouseEventArgs e)    {      if (e.Button != MouseButtons.Left) return;      downPoint = Point.Empty;    }  }}

希望本文所述對大家的C#程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 江城| 德令哈市| 凤城市| 宜章县| 易门县| 米林县| 伊吾县| 西昌市| 塔河县| 工布江达县| 全州县| 卓资县| 甘孜| 海林市| 远安县| 南昌县| 连城县| 烟台市| 尼木县| 略阳县| 远安县| 宜兰市| 托里县| 蓝山县| 拜城县| 余江县| 景泰县| 湘阴县| 读书| 青浦区| 恩施市| 莱西市| 剑川县| 那曲县| 马边| 乐都县| 成安县| 甘洛县| 克拉玛依市| 安达市| 吉安县|