Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create button with rounded corners/edges on Winform C#?

Well I'll be putting an image on the button, and that image has rounded corners. How do I make this happen? I've been googling and searching for hours, still no luck on it.

like image 317
user3195396 Avatar asked Jan 14 '14 19:01

user3195396


People also ask

How do you make a button have rounded corners CSS?

To create a rounded button you have to make use of the border-radius CSS property. The higher the value for that property the more rounder the corners will be. You can use any CSS unit for the boorder-radius property. It can be pixels, ems, rems, percentages etc.

How do you make a round edge button?

Rounded corners HTML Buttons You can make rounded corners button by adding border-radius of 5px to 10px on HTML buttons.


1 Answers

You can use the rectangle shape from Microsoft Visual Basic PowerPacks.

There is documentation at How to: Draw Shapes with the OvalShape and RectangleShape Controls

I checked it works in a C# Windows forms project in VS2013 Express for Windows Desktop on Windows7 x64, targeted at both x86 and x64. User xam reports that it also works with VS2017.

private void rectangleShape1_Click(object sender, EventArgs e)
{
    MessageBox.Show("Click!");
}

When the program is run

For convenience, you can add a new Toolbox tab and add the VB PP controls to it.

like image 150
Andrew Morton Avatar answered Sep 20 '22 11:09

Andrew Morton