Advertisement
EnverX

Visual Studio Bordes Redondos

Mar 26th, 2023 (edited)
1,078
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Runtime.InteropServices;
  4.  
  5. namespace WindowsFormsApplication1
  6. {
  7.     public partial class Form1 : Form
  8.     {
  9.         [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
  10.         private static extern IntPtr CreateRoundRectRgn
  11.         (
  12.             int nLeftRect,     // x-coordinate of upper-left corner
  13.             int nTopRect,      // y-coordinate of upper-left corner
  14.             int nRightRect,    // x-coordinate of lower-right corner
  15.             int nBottomRect,   // y-coordinate of lower-right corner
  16.             int nWidthEllipse, // height of ellipse
  17.             int nHeightEllipse // width of ellipse
  18.         );
  19.  
  20.         public Form1()
  21.         {
  22.             InitializeComponent();
  23.             this.FormBorderStyle = FormBorderStyle.None;
  24.             Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 15, 15));
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement