Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom titlebars/chrome in a WinForms app

I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked.

Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know that one way to accomplish this from WinForms would be to create a borderless form and draw the caption bar/buttons yourself, then overriding WndProc to make sure moving, resizing, and button clicks do what they're supposed to do (I'm not clear on the specifics but could probably pull it off given a day to read documentation.) I'm curious if there's a different, easier way that I'm overlooking. Perhaps some API calls or window styles I've overlooked?

I believe Google has answered it for me by using the roll-your-own-window approach with Chrome. I will leave the question open for another day in case someone has new information, but I believe I have answered the question myself.

like image 221
OwenP Avatar asked Sep 03 '08 20:09

OwenP


1 Answers

Here's an article with full code sample on how to use your own custom "chrome" for an application:

http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx

This looks like some really good stuff. There are a total of 3 articles in it's series, and it runs great, and on Vista too!

like image 135
Chris Pietschmann Avatar answered Sep 19 '22 13:09

Chris Pietschmann