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

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
J

Justin Creasy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top