Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

windows form rounded corners

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
        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, // width of ellipse
            int nHeightEllipse // height of ellipse
        );

        public Form1()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.None;
            Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity save list to json 
Csharp :: c# get display resolution 
Csharp :: random from list c# 
Csharp :: c# get bytes from string 
Csharp :: wait in unity 
Csharp :: how to destroy object in unity c# 
Csharp :: how to get all files from folder and subfolders in c# 
Csharp :: Schema::defultString larvel 
Csharp :: c# console create window 
Csharp :: unity string format time 
Csharp :: c# ipaddress from localhost 
Csharp :: playerInputManager.JoinPlayer(....) 
Csharp :: add row to datagridview c# 
Csharp :: c# datediff minutes 
Csharp :: unity how to add force 
Csharp :: phone number regex in c# 
Csharp :: how to start a coroutine in c# 
Csharp :: website link in unity 
Csharp :: unity find closest point on line 
Csharp :: hide game obj oncollisionenter 
Csharp :: random character c# 
Csharp :: text not centered winforms button 
Csharp :: unity list to array 
Csharp :: xamarin timer example 
Csharp :: how to show a reference in unity 
Csharp :: monogame fullscreen 
Csharp :: unity iterate all child objects 
Csharp :: unity put children in list 
Csharp :: time.timescale 
Csharp :: c# get random double in range 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =