Click here to Skip to main content
15,566,240 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys,
I've been looking for a method through which i can change the color of the title bar in my application.
Thanks in advance,
Regards,
Akkywadhwa
Posted

The correct approach to a different color of the title bar would be to apply a skin to the whole form. There are several toolkits for .Net that do that for you e.g.
http://www.skincrafter.com/[^]
http://www.devexpress.com/Products/Index/themes.xml[^]
 
Share this answer
 
Comments
Espen Harlinn 26-Mar-12 18:28pm    
5'ed!
Wonde Tadesse 26-Mar-12 18:59pm    
5+
ProEnggSoft 26-Mar-12 21:02pm    
Good pointers. +5
Have a llok at:Use the Free USkin Toolkit to Skin your Application[^]

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Wonde Tadesse 26-Mar-12 18:59pm    
5+. Even though the example is VC++
Espen Harlinn 26-Mar-12 19:03pm    
Thanks, the author provides a small example in c# at the end of the article.
Wonde Tadesse 27-Mar-12 19:05pm    
Opps my mistake. :)
ProEnggSoft 26-Mar-12 21:00pm    
Good pointer. +5
Espen Harlinn 27-Mar-12 5:21am    
Thank you :-D
I think the following Code Project article
Winforms SkinFramework[^]
may also be helpful.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Mar-12 21:15pm    
Yes, my 5.
--SA
ProEnggSoft 26-Mar-12 21:19pm    
Thank you very much.
Abhinav S 26-Mar-12 21:50pm    
5!
ProEnggSoft 26-Mar-12 22:37pm    
Thank you very much.
Espen Harlinn 27-Mar-12 5:20am    
Nice article, 5'ed!
I would strongly recommend to give up with that. The library System.Windows.Forms does not offer such functionality, so you will need to use some elements of raw Windows API.

The problem is solved handling the Windows message WM_NCPAINT:
http://msdn.microsoft.com/en-us/library/dd145212%28v=vs.85%29.aspx[^].

Please see this discussion for some sample solution:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/eebf03d0-1242-4fef-857c-5b9e1d38b2f2/[^].

Again, I do not recommend this trouble. You would pay by loosing compatibility with non-Windows systems. Did you know that you can run your .NET applications using Forms on many other platforms? You will loose this opportunity. More important, you will potentially loose compatibility with future Microsoft systems using SLR. One of Microsoft directions of development leads out of Windows. The Windows features you want to implement using those dirty tricks (legitimate in native Windows, which is going to go obsolete) will hardly be supported in future. Why bothering about them?

—SA
 
Share this answer
 
Comments
Akkywadhwa 26-Mar-12 16:14pm    
Could you please explain "WM_PAINT" with a demo project?
Regards,
Akkywadhwa
Sergey Alexandrovich Kryukov 26-Mar-12 18:45pm    
This is not "WM_PAINT", this is WMNCPAINT. Please see the second link for a code sample.
Or do you need WM_PAINT as well?
--SA
Espen Harlinn 26-Mar-12 18:30pm    
Good points :-D
Sergey Alexandrovich Kryukov 26-Mar-12 18:44pm    
Thank you, Espen.
--SA
Wonde Tadesse 26-Mar-12 18:59pm    
5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900