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.Drawing.Drawing2D;

namespace Ex01_8
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            GraphicsPath Myformpath = new GraphicsPath();      //创建一个路径对象
            Myformpath.AddEllipse(10, 50, this.Width - 10, this.Height - 50);
            //使用椭圆构造一个区域，并将此区域作为程序窗体区域
            this.Region = new Region(Myformpath);

        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}
