How Create Nonrectangular form in c#.net 2005
-
i want to write the Nonrectangular form in c#.net 2005 . in c# 2003 set FormBorderStyle to None and set BackgroundImage to file that shown as background then set TransparencyKey property to backcolor of BackgroundImage but this doesn't work in c# 2005 . i don't want to use GDI+ and Region property of form . please help me.thanks. :rose:
-
i want to write the Nonrectangular form in c#.net 2005 . in c# 2003 set FormBorderStyle to None and set BackgroundImage to file that shown as background then set TransparencyKey property to backcolor of BackgroundImage but this doesn't work in c# 2005 . i don't want to use GDI+ and Region property of form . please help me.thanks. :rose:
you can overwrite the OnPaint method: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { System.Drawing.Drawing2D.GraphicsPath shape = new System.Drawing.Drawing2D.GraphicsPath(); Point[] points = new Point[6]; points[0] = new Point(0, 0); points[1] = new Point(this.Width, 0); points[2] = new Point((this.Width/2)+1, this.Height/2); points[3] = new Point(this.Width, this.Height); points[4] = new Point(0,this.Height); points[5] = new Point((this.Width / 2) - 1, this.Height / 2); shape.AddPolygon(points); this.Region = new System.Drawing.Region(shape); } ... and you will have a glasshour shaped form...