Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I'll show you where to put some codes if you don't know.
- using System;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] // This code goes up public Form1()
- private static extern IntPtr CreateRoundRectRgn
- (
- int nLeftRect, // x-coordinate of upper-left corner
- int nTopRect, // y-coordinate of upper-left corner
- int nRightRect, // x-coordinate of lower-right corner
- int nBottomRect, // y-coordinate of lower-right corner
- int nWidthEllipse, // height of ellipse
- int nHeightEllipse // width of ellipse
- );
- public Form1()
- {
- InitializeComponent(); // You don't have to copy and paste this. It's not needed.
- this.FormBorderStyle = FormBorderStyle.None; // this code goes under InitializeComponent();
- Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement