I was trying to create a round button. For this, we need to create a class, here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace CircularButton
{
internal class CircularButton :Button
{
protected override void OnPaint(PaintEventArgs pevent)
{
GraphicsPath g = new GraphicsPath();
g.AddEllipse(0, 0, ClientSize.Width, ClientSize.Height);
this.Region = new System.Drawing.Region(g);
base.OnPaint(pevent);
}
}
}
After creating and coding this class, we need to rebuild the solution, after rebuilding, we must see the new CİRCLE BUTTON tool in the TOOLBOX:
However, I do not get neither this circule button option nor the "applicationName Components" tab:
I do not have both. How can I solve this problem?
Source of the images I use is this video: https://www.youtube.com/watch?v=HG7hi9s7YhQ
Edit: If I right-click toolbox and click on "show all" ,it gives my tab which is named as "HarryPotter" and there is "CircleButton" tool in it, but I can not drag it to Forms because it is inactive(the relevant icon seems dark):