Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
This post was edited and submitted for review 4 months ago and failed to reopen the post:
Improve this questionOrigi开发者_运维技巧nal close reason(s) were not resolved
i want to know how can i make the button shape circle in C#? thanks
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;//add this namespace
namespace shapes
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(0, 0, button1.Width, button1.Height);
button1.Region = new Region(gp);
gp.Dispose();
}
}
}
I successfully made circled custom buttons by using PictureBox and implementing on it the Click (or MouseClick) Action:
精彩评论