Can someone tell me how to create tabs in the title bar area of a C# Winforms application? I'm looking for something similar to how Google Chrome looks. Each tab in Chrome is docked in the title bar of the main application window.
+1
A:
Try setting FormBorderStyle of your form to None. I think if you look around there are some articles on how to build a UI like this where you can still have the drag functionality you'd lose by hiding the title bar. Then you could build up the title bar area the way you wanted it to work.
Wil P
2010-08-19 22:57:49
This is a viable option, however, I don't think Chrome uses this technique. In Chrome, you still get the standard "minimize", "Maximize" and "Restore" buttons plus you still get the Aero Glass effect on the title bar.
icemanind
2010-08-19 22:59:52
I wonder if they are just creating the behavior of Minimize, Maximize, Restore, with their own control? Honestly I don't know, but I would suspect it's what they are doing. Here is an example of someone who designed a customized title bar... http://www.dreamincode.net/forums/topic/64981-designing-a-custom-title-bar/
Wil P
2010-08-19 23:04:56
@icemanind Chrome also doesn't use windows forms. Windows forms limits some of the things you can do in exchange for behind able to do those things _much_ more easily.
Joel Coehoorn
2010-08-19 23:05:14
@Joel What do they use? WPF?
icemanind
2010-08-19 23:16:36
@icemanind I believe they use the win32 api directly from C++
Joel Coehoorn
2010-08-19 23:27:12
Win32 API allow for you to draw anything you want in the titlebar (actually so did the win16 api ;-)
FastAl
2010-08-20 11:37:30
... by handling the WM_NC* family of Window messages. That can be done in managed code too by overriding WndProc, but it's not exactly straight forward.
Mattias S
2010-08-20 13:58:09
They may have, but in windows forms, a borderless form would definitely be your best bet to duplicate this kind of functionality. Just make it borderless and then create a custom Titlebar control that has tabs and whatnot. You can also build in the minimize/maximize/close buttons with very little difficulty -- except that of creating the actual graphics, of course.
Joshua Evensen
2010-08-23 12:39:25