Navigation

Search

Categories

On this page

ColorButton Control v1.7

Archive

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 12
This Year: 0
This Month: 0
This Week: 0
Comments: 0

Sign In

 Sunday, May 20, 2007
Sunday, May 20, 2007 10:32:03 AM UTC (  |  )
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:



Comments [0] | Trackback | # 
Related posts:
Visual Studio 2008 Compatibility
Controls Updated to Support Visual Studio 2008 (.NET 3.5)
Helpful tools
ILMerge GUI Source Code & Application
Custom Control Design Time Attributes
Using Assembly Resources
Tracked by:
http://www.google.com/search?q=lpjgjnxr [Pingback]
http://www.pny.com/pressroom/pressreleases/view.asp?pressID=464 [Pingback]
http://www.pny.com/pressroom/pressreleases/view.asp?pressID=454 [Pingback]
http://www.nctd.com/printversion-review.cfm?ReviewID=2243 [Pingback]
http://www.highschooljournalism.org/students/ask_a_pro/article.cfm?articleId=290 [Pingback]
http://www.nctd.com/printversion-review.cfm?ReviewID=2237 [Pingback]
http://www.highschooljournalism.org/students/ask_a_pro/article.cfm?articleId=305 [Pingback]
http://www.aapt.org/olympiad2006/bio.cfm?StudentID=744 [Pingback]
http://www.aapt.org/olympiad2006/bio.cfm?StudentID=764 [Pingback]
http://www.aapg.org/education/fieldseminars/details.cfm?ID=164 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3399 [Pingback]
http://www.aapt.org/olympiad2006/bio.cfm?StudentID=742 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3390 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3377 [Pingback]
http://www.highschooljournalism.org/students/ask_a_pro/article.cfm?articleId=289 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3383 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3391 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3394 [Pingback]
http://www.ajga.org/Media_Center/Clips/Artical.asp?AID=3379 [Pingback]
http://tubepornoss.com [Pingback]
http://yesihavemoneyy.com [Pingback]
http://realvideopornoo.com [Pingback]
http://blastpr.com/wiki/js/pages/zoloft/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/cymbalta/index.html [Pingback]
http://blastpr.com/wiki/js/pages/prozac/index.html [Pingback]
http://blastpr.com/wiki/js/pages/clomid/index.html [Pingback]
http://blastpr.com/wiki/js/pages/claritin/index.html [Pingback]
http://blastpr.com/wiki/js/pages/ultram/index.html [Pingback]
http://blastpr.com/wiki/js/pages/rainbow-brite/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/lexapro/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/soma/index.html [Pingback]
http://blastpr.com/wiki/js/pages/effexor/index.html [Pingback]
http://blastpr.com/wiki/js/pages/wellbutrin/index.html [Pingback]
http://blastpr.com/wiki/js/pages/melatonin/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/prilosec/index.html [Pingback]
http://morningside.edu/mics/_notes/pages/nexium/index.html [Pingback]