OK I have a custom Circular Button that I extended from Button class. See Below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace CircleButton
{
public class CircleButton : Button
{
private Color _fillColor = Color.Red;
private Color _hoverColor = Color.Blue;
[Category("Custom")]
[Browsable(true)]
[Description("Sets the fill color of the round button")]
[Editor(typeof(System.Windows.Forms.Design.WindowsFormsComponentEditor), typeof(System.Drawing.Color))]
public Color FillColor
{
set
{
this._fillColor = value;
}
get
{
return this._fillColor;
}
}
[Category("Custom")]
[Browsable(true)]
[Description("Sets the Hover color of the round button")]
[Editor(typeof(System.Windows.Forms.Design.WindowsFormsComponentEditor), typeof(System.Drawing.Color))]
public Color HoverColor
{
set
{
this._hoverColor = value;
}
get
{
return this._hoverColor;
}
}
protected override void OnPaint(PaintEventArgs pevent)
{
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(0, 0, ClientSize.Width, ClientSize.Height);
this.Region = new System.Drawing.Region(gp);
base.OnPaint(pevent);
}
protected override void OnCreateControl()
{
this.FlatAppearance.MouseOverBackColor = this._hoverColor;
this.FlatAppearance.BorderSize = 0;
this.BackColor = this._fillColor;
this.FlatStyle = FlatStyle.Flat;
base.OnCreateControl();
}
}
Everthing works great in the Visual Studio Designer, but when I select the FillColor and HoverColor properties during design time, the colors on the design time control do not update.
Keep in mind that the colors DO show the appropriate change during runtime.
Maybe I am missing another directive or something? I have searched but unable to come up with an answer. I have spent 2 days on this.
This control is going to be distributed to another designer and needs to work properly during design time.
Any help would be most appreciated.