First create a class. Give it the name Round Button. Then write the code directly as follows:
using System; using System.Collections.Generic; using System.Drawing.Drawing2D; using System.Windows.Forms; using System.Linq; using System.Text; namespace WindowsFormsApplication1 { public class RoundButton : Button { protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { GraphicsPath grPath = new GraphicsPath(); grPath.AddEllipse(0, 0, ClientSize.Width, ClientSize.Height); this.Region = new System.Drawing.Region(grPath); base.OnPaint(e); } } }
Then create the application and close it. Now go to the toolbar and you will see a control named RoundButton. Then dope and drop it on the shape of your window and test it ...... Enjoy!
source share