How to develop an application like Google Chrome browser in WPF using C# How to develop an application like Google Chrome browser in WPF using C# google-chrome google-chrome

How to develop an application like Google Chrome browser in WPF using C#


Google Chrome essentially custom-draws the non-client area of its window to remove things that it considers superfluous like the title bar. That's how it gets the tabs to replace the title bar of the window, just like how Microsoft Office places its "pearl" and quick access toolbar in the title area of document windows.

To do something similar in WPF, you may find this article useful: http://blogs.msdn.com/b/wpfsdk/archive/2008/09/08/custom-window-chrome-in-wpf.aspx

Remember that any time you re-implement the standard windows chrome, you're going to have to handle a bunch of stuff that Windows normally makes transparent to you, like resizing, minimizing, maximizing, moving, and closing a window.

It is worth considering that both Google Chrome and Microsoft Office applications (among others) behave differently depending on whether Aero Glass and the Desktop Window Manager (DWM) are present/enabled. You're going to have to make sure that your application degrades gracefully when these things are missing. I would advise being sure that you can really make a convincing case for the necessity and benefit to the users before you invest all the time and energy it takes to do things like this in your application.


It appears that Chrome draws its tabs within a limited region of the title bar area. When enough tabs are open, the width of existing tab controls is reduced to make room for a new tab.

I would suggest that you adopt a similar strategy by drawing your tabs in a suitably sized Rectangle which does not intersect with the caption buttons (Minimize, Maximize Close) and reducing the width of existing tab headers when the region becomes full

[Update 1]

While I haven't seen your code, I would suggest this happens because the tab header (the part displayed in the title bar area) and the tab page (the part covering most of the screen) are a part of the same control and are drawn as a unit, so when you try and draw the header in the region the tab content is redrawn too.

If this is the case, then you need to draw the tab header and the content page as separate controls and maintain some state in the tab that indicates which tab page should become visible when the tab is selected.