开发者

how to change the shape of button? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

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:

Origi开发者_运维技巧nal close reason(s) were not resolved

Improve this question

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:

how to change the shape of button? [closed]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜