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));
}
}
}
Also in C#:
- making pong in unity
- how to move clipping planes C# in unity
- open tcp socket c#
- unity randomly generated numbers c#
- c# ienumerable to list
- C# Unknown column 'FundAllocation' in 'field list
- wpf use enum description
- convert array object to int[] c#
- c list add element
- c# arrays of arrays
- remove from list based on condition c#
- unity get number of child objects
- get random value from list c#
- Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
- c# unity max
- unity c# set gameobject active
- C# linq mselect
- MVC creating a counter for products
- how to go to other forms in C#
- c# save pdf to folder
- count number of enum values C#
- how to pass an optional parameter in c# mvc asp.net
- unity coroutine
- unity enum