废话不多言,直接代码:
public class RoundButton : Button
{
bool clickBool = false;
//1.设置圆形
//2.设置渐变色
//3.设置tooltip
//4.设置点击之后渐变色,tooltip
ToolTip toolTip = new ToolTip();
public RoundButton()
{
toolTip.AutoPopDelay = 1000;
toolTip.SetToolTip(this, "A: B分列选图。");
}
[Browsable(true), DefaultValue(90), Description("按钮主体颜色渐变方向,X轴顺时针开始")]
[Category("Appearance")]
public int GradientAngle { get; set; }
protected override void OnPaint(PaintEventArgs pevent)
{
base.OnPaintBackground(pevent);
RectangleF rect = new RectangleF(0, 0, this.Width, this.Height);
//两种brush使用 LinearGradientBrush和PathGradientBrush
//Graphics g =