You can use a function available in gdi32.dll, by calling it in the constructor of the form.
From my experience the Border seems to not apply on the rounded corners.
public partial class LoginForm : 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, // height of ellipse
int nHeightEllipse // width of ellipse
);
public LoginForm()
{
InitializeComponent();
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn( 0, 0, Width-10, Height-10, 20, 20)); // adjust these parameters to get the lookyou want.
}
vendredi 05 septembre 2008 | Predicate<T>
Cher Entreprenaute, vous pouvez trouver ici votre passeport pour l'economie numerique
Smart Code Generator
Serialcoder participe activement au projet opensource Smart Code Generator
smartcodegenerator