Set irregular shape for windows form

来源:互联网 发布:视频特效软件 编辑:程序博客网 时间:2024/05/22 02:06

在.net window form编程中,窗体都以矩形方式展现给用户,我们可以将窗体个性化,创建非矩形的Windows窗体。

        private void Form1_Paint(object sender, PaintEventArgs e)
        
{

            System.Drawing.Drawing2D.GraphicsPath shape 
= new System.Drawing.Drawing2D.GraphicsPath();
            shape.AddEllipse(
00this.Width, this.Height);
            
this.Region = new System.Drawing.Region(shape);
        }
原创粉丝点击