C#绘制圆角窗体_idepublic     void    SetWindowRegion()     

C#绘制圆角窗体_ide_02C#绘制圆角窗体_ide_03   ... {     

C#绘制圆角窗体_2d_04  System.Drawing.Drawing2D.GraphicsPath   FormPath;     

C#绘制圆角窗体_2d_04  FormPath   =   new   System.Drawing.Drawing2D.GraphicsPath();     

C#绘制圆角窗体_2d_04  Rectangle   rect=new   Rectangle(0,22,this.Width,this.Height-22);//this.Left-10,this.Top-10,this.Width-10,this.Height-10);                 

C#绘制圆角窗体_2d_04  FormPath   =   GetRoundedRectPath(rect,   30);   

C#绘制圆角窗体_2d_04  this.Region   =   new   Region(FormPath);     

C#绘制圆角窗体_ide_09  }    

C#绘制圆角窗体_ide   private    GraphicsPath   GetRoundedRectPath(Rectangle   rect,    int    radius)     

C#绘制圆角窗体_ide_02C#绘制圆角窗体_ide_03   ... {   

C#绘制圆角窗体_2d_04  int   diameter   =   radius;   

C#绘制圆角窗体_2d_04  Rectangle   arcRect   =   new   Rectangle(rect.Location,   new   Size(diameter,   diameter));   

C#绘制圆角窗体_2d_04  GraphicsPath   path   =   new   GraphicsPath();   

C#绘制圆角窗体_2d_04  //   左上角   

C#绘制圆角窗体_2d_04  path.AddArc(arcRect,   180,   90);   

C#绘制圆角窗体_2d_04  //   右上角   

C#绘制圆角窗体_2d_04  arcRect.X   =   rect.Right   -   diameter;   

C#绘制圆角窗体_2d_04  path.AddArc(arcRect,   270,   90);   

C#绘制圆角窗体_2d_04  //   右下角   

C#绘制圆角窗体_2d_04  arcRect.Y   =   rect.Bottom   -   diameter;   

C#绘制圆角窗体_2d_04  path.AddArc(arcRect,   0,   90);   

C#绘制圆角窗体_2d_04  //   左下角   

C#绘制圆角窗体_2d_04  arcRect.X   =   rect.Left;   

C#绘制圆角窗体_2d_04  path.AddArc(arcRect,   90,   90);   

C#绘制圆角窗体_2d_04  path.CloseFigure();   

C#绘制圆角窗体_2d_04  return   path;   

C#绘制圆角窗体_ide_09  }    

C#绘制圆角窗体_ide   protected     override     void    OnResize(System.EventArgs   e)     

C#绘制圆角窗体_ide_02C#绘制圆角窗体_ide_03   ... {     

C#绘制圆角窗体_2d_04  this.Region   =   null;     

C#绘制圆角窗体_2d_04  SetWindowRegion();     

C#绘制圆角窗体_ide_09  }