It was brought to my attention that the ColorButton control had no way of determining that it had focus!!!
We stuck with the standard button behavior of thickening the border of the button when focused.
The DrawColorButton method looks like this now:
private void DrawColorButton()
{
CollectColors();
// draw the button to the screen
switch (_ButtonShape)
{
case ButtonShape.Ellipse :
if (_ShowGradient)
Draw.Gradient(_Graphics, this.Bounds, _BackDownColor, BackColor, (int)_GradientDirection, (int)_ButtonShape);
else
_Graphics.FillEllipse(_Brush, 0, 0, Width-1, Height-1);
_Graphics.DrawEllipse(_Pen, 0, 0, Width-1, Height-1);
if (base.Focused)
_Graphics.DrawEllipse(_Pen, 1, 1, Width - 3, Height - 3);
break;
case ButtonShape.Rectangle :
if (_ShowGradient)
Draw.Gradient(_Graphics, this.Bounds, _BackDownColor, BackColor, (int)_GradientDirection, (int)_ButtonShape);
else
_Graphics.FillRectangle(_Brush, 0, 0, Width, Height);
_Graphics.DrawRectangle(_Pen, 0, 0, Width-1, Height-1);
if(base.Focused)
_Graphics.DrawRectangle(_Pen, 1, 1, Width - 3, Height - 3);
break;
}
DrawStringToButton();
DrawIconToButton();
}
Those of you who purchased the control in the last 6 months would like the update please send me an email.
There is still no way of determining if the ColorButton has focus when using images and we will add this functionality in the near future. If there are any of you who would like to see a new image property added to cater for the focused state, please let me know and we can push that along.
You can see here that colorButton2 has focus:
