Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Changing Windows Forms Header Color
 

Changing Windows Forms Header Color

Hi Friends,

In my windows application in C#.NET 2005 i want to change the window title bar as well as status bar colors. I tried but directly no property is exposed so that i can easily assign the values to it.

I don't know how to do it and i am new to windows forms even i surfed in net most of the suggestions are given that it is not possible. Some code they have shown in CodePlex.com but i didn't understood where exactly we need ti implement in form load or else where....

And many of them are suggesting to do in WPF, since we have developing this application in c# .net 2005, again it will be rework for us.


Hope i will get any help from you guyz


thanks
Chetan

Chetan
Chetan VD  Tuesday, January 06, 2009 11:33 AM
Hi Chetan VD,

Indeed there is no direct property we can set to change the color of the title bar. However, There are two ways we can try.

For the first way, we can trap the WMNCPaint event, and then draw our custom boarders.

For the second way, we can hide the default Boarder and completely draw it ourselves. In this case, we probably need to deal with some mouse events to achieve the function like the title bar. Such as, we can move the form when we drag the form header.

I know you probably have seen the code project in the CodePlex.com, but I don't know if you've seen the blog assosiating with it. I think the blog has a good explanation with the two ways.

If you have problems, please let us know which part you are not clear.

Best regards,
Bruce Zhou.

Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Wednesday, January 07, 2009 6:48 AM
We are changing the issue type to "General Discussion" because you have not followed up with the necessary information.If you have more time to look at the issue and provide more information, please feel free to change the issue type back to "Question" by editing your initial post and changing the combobox at the bottom right of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

Thank you!
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, January 12, 2009 1:43 AM

You can use google to search for other answers

Custom Search

More Threads

• The small report screen doesn't work
• Install TV Server into SQL Named Instance?
• Terrarium 1.2 strange error
• Where can i get the issuevision's c# code??
• Update on download availability?
• Default Namespace Issue
• Data Source
• linking two forms in C#
• Installation not working
• Web Service location