Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have searched this topic in several forums and in most cases it is suggested that I create a borderless form and draw my own titlebar and borders and then handle all the moving and resizing events. I do not want to use this approach. Instead I want to use the windows API to ONLY recolor the titlebar and borders. I have not been able to find any code examples in VB.NET that actually work.

Has anyone ever successfully re-colored a .Net form titlebar? If so, please share the code. Preferably in VB
Posted

There is no Windows API call to set the title bar color. As Dave mentioned, it's a pain to recreate the title bar in code, but it's less difficult if you are using WPF or Silverlight.
 
Share this answer
 
You would have to draw the entire non-client area of the form yourself. The reason you don't find any code to do this is because nobody does it. It's a giant pain in the ass with little to no benefit.
 
Share this answer
 
I was able to get what I want using the code I posted here:
Drawing Graphics in Titlebar in Windows 7[^]

However, it only works in XP. I am guessing that this is why i could not get any of the other articles with code samples to work. In windows 7 after getting the windows messages and drawing the graphics, the customer border and titlebar is drawn over again by Windows. This does not happen in XP.

Many thanks for taking the time to read this and offering some ideas!
 
Share this answer
 

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