最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#非矩形窗體實(shí)現(xiàn)方法

 更新時(shí)間:2015年06月11日 12:30:36   作者:zhuzhao  
這篇文章主要介紹了C#非矩形窗體實(shí)現(xiàn)方法,涉及C#窗體操作的相關(guān)技巧,需要的朋友可以參考下

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

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;
    }
  }
}

希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

北辰区| 玛曲县| 平和县| 夏邑县| 黄大仙区| 全州县| 正镶白旗| 福海县| 崇明县| 芦溪县| 会理县| 青海省| 盐亭县| 成都市| 禹城市| 瑞昌市| 东乌珠穆沁旗| 天柱县| 台山市| 阆中市| 田林县| 岳阳县| 遂平县| 巴林左旗| 沁源县| 麻江县| 宁陵县| 常州市| 腾冲县| 双峰县| 阿拉善左旗| 电白县| 慈溪市| 渭源县| 沭阳县| 略阳县| 巫溪县| 平湖市| 乌什县| 福泉市| 彰化市|