Thursday, March 3, 2011

How to override background color for WinForm minimize and maximize buttons

Is it possible to override the background color of the minimize and maximized buttons in WinForms?

From stackoverflow
  • Not without writting your own NC_PAINT which is very bad practice by itself.

    You never know when the user will use a new visual style never heard before. Your application will display the old ugly buttons over the existing style and everything will clash.

  • You cannot do it easily.

    The best option is: http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx

    You can find more answers here: http://stackoverflow.com/questions/42460/custom-titlebarschrome-in-a-winforms-app

  • The short version is, out of the box, not that I'm aware of.

    The longer version is that there's nothing stopping you from creating a borderless form, then creating your own [minimize|restore]/maximize/close buttons on it. You'll have to draw your own form title bar, and basically take on all the magic of moving onscreen and such, but it's not impossible.

    Consider this article from Code Maverick as a starting point.

  • Hi there, i once tried to something similar. It took too much time, plus there are plenty of third party controls out there. I use the following Krypton Toolkit, its great and the toolkit is free.

  • I had a feeling it wouldn't be easy! Thanks for the responses.

0 comments:

Post a Comment