Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How Create Nonrectangular form in c#.net 2005

How Create Nonrectangular form in c#.net 2005

Scheduled Pinned Locked Moved C#
csharpwinformsgraphicshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mohammadSoft
    wrote on last edited by
    #1

    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:

    C 1 Reply Last reply
    0
    • M mohammadSoft

      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:

      C Offline
      C Offline
      c_onica
      wrote on last edited by
      #2

      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...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups