Advertisement
Fhernd

Principal.cs

Mar 8th, 2018
1,647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Drawing;
  3. using System.Drawing.Drawing2D;
  4. using System.Windows.Forms;
  5.  
  6. namespace R803FormularioIrregular
  7. {
  8.     public partial class Principal : Form
  9.     {
  10.         public Principal()
  11.         {
  12.             InitializeComponent();
  13.         }
  14.  
  15.         private void Principal_Load(object sender, EventArgs e)
  16.         {
  17.             GraphicsPath path = new GraphicsPath();
  18.  
  19.             Point[] puntosA = new Point[]
  20.             {
  21.                 new Point(0, 0),
  22.                 new Point(40, 60),
  23.                 new Point(this.Width - 100, 10)
  24.             };
  25.  
  26.             path.AddCurve(puntosA);
  27.  
  28.             Point[] puntosB = new Point[]
  29.             {
  30.                 new Point(this.Width - 40, this.Height - 60),
  31.                 new Point(this.Width, this.Height),
  32.                 new Point(10, this.Height)
  33.             };
  34.             path.AddCurve(puntosB);
  35.  
  36.  
  37.             path.CloseAllFigures();
  38.  
  39.             this.Region = new Region(path);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement