Windows Form Rounded Corners in C# || Form Border Radius C#- Visual Studio

preview_player
Показать описание
How Create a Modern Designed form Using Windows form Application C#.Best Form With Rounded Corners || easy to make

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

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
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();
this.FormBorderStyle = FormBorderStyle.None;
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
}
}
}

========================================

THANK YOU

========================================

Share, Support, Subscribe!!!
Рекомендации по теме
Комментарии
Автор

Thank you so, so much not many people go the extra mile and provide the code, for that I salute you.

ga
Автор

Tooooppp greatfull... Fast and simple tip

AdelsonSilvaarms
Автор

Awesome! Now I can make my UI looked better. Thanks so much! +1 Like

consectial
Автор

thx but i wondering how you do this on stuff like lables and textboxs

city_
Автор

Thank you so much. Very helpful for me.

Автор

Gracias, hayforma de suavizar el borde para que no se vea tan pixelado?

dahianabasigaluz
Автор

I swear that is miracle man guitar cords in the background

Maxfficial
Автор

STILL WORKING APRIL 2021 and without anyproblems, thanks

videogamebot
Автор

Works really well, looks nice too. Ty man

shutupbequiet.
Автор

This was very helpful, thank you for this tutorial

abedyounis
Автор

You're my hero. Thank you so, so, so much :)

yusufsahin
Автор

thank you, It's Done but the edges are not smooth. is there any solution for that?

SachinUphade
Автор

Works nice but how to move it if FormBorderStyle.None; ? With defined borderstyle it is not looking as good as without.

ukaszjozwiak
Автор

Thank, but can you make the animation script to edge corner change to rounded corners ?

Icou
Автор

that works and I dont need any framework, thank you I subbed now. Btw can you do tutorial for rounded buttons ?

scripter-ggwq
Автор

Como sería el codigo para bordear un PictureBox?

Smueln
Автор

is that miracle man guitar cords in the background??

Maxfficial
Автор

It works thanks. How do I make it so that the window is draggable?

ghzich
Автор

if I add border color to this only the top and left border is colored

zerosandones