How to change the color of a app's title bar?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

How do I change the color of the app's title bar (where you have the Close,
Minimize and Maximize buttons) in C#?

Mateusz
 
Mateusz,

You could go and change the colors system-wide, but I don't think that's
what you want to do. To do it for an individual window, you will have to
custom paint the frame.

What you want to do is on the Form class, override the WndProc method,
and then handle the WM_NCPAINT message. This will notify you when the frame
needs to be redrawn. Then, you have to do it yourself, from scratch.

Hope this helps.
 
Another way to handle it would be to completely remove the titlebar and
to create your own titlebar that is docked to the top. It's a bit of
work, but then you have complete control of the design.
 
Back
Top