noxa.org

Project: WhidbeyTabControl


Overview
Name:WhidbeyTabControl
Authors:Ben Vanik (noxa)
Started:2004-07-02Finished:2004-07-03
Status:Completed
Technologies:.NET / C# / User Interface
Requirements:.NET Framework 2.0, Visual Studio 2005
Release policy:Public - Source available
Additional help:N/A
Category:User Interface
Synopsis:Visual Studio 2005 style tab control.

Contents
ScreenshotsDownloads
Revision historyDetails

Screenshots
General2004-07-03
Simple shot displaying the control on a tab page (note that it is transparent), with an item hovered and an item selected.





Downloads
DateVersionBinarySource
2004-07-031.001.0000Archive [22KB]Archive [50KB] (see terms)

Revision history
DateVersionTypeComments
2004-07-031.001.0000Initial releaseFirst release, still a few enhancements that are needed, but it mimics the VS version perfectly.

Details

Date:

2004-07-03

Author:

Ben Vanik (noxa)
I've often had a need for a tabbed browser that is a little nicer than just tab pages, and liked the Windows Media Player style. After seeing the control included with the latest Visual Studio 2005 releases, I got the urge to replicate it as it not only did what I wanted but looked really nice.

I first tried inheriting from TabControl and doing my own drawing, but quickly realized the limitations of the control (mainly due to the fact that it's just a wrapper around the Win32 version). This final version is inherited from a UserControl, and since I am lazy it is not as nice as a TabControl, but since its use is different I felt it was ok; rarely will tabs be removed, reordered, etc.

Another design decision I made was to use Label controls to do the text drawing as opposed to just using DrawString. The reason for this is that I love text smoothing, and DrawString doesn't cut it. Either you don't have it, or you force a weak version of it, and that doesn't work when the user is expecting services like ClearType to extend to all of their applications. So, because I used Labels, the system settings will act on the text just like normal.

As it stands, the control is usable and works well, although there is some work that still needs to be done. See the todo list below for more information. Funny thing is that the real control doesn't allow keyboard navigation either - so I don't feel so bad about being too lazy to implement it ;)

The only two differences between this and the real thing are that the tabs are 1 pixel off in width and the background doesn't change colors to work on non-Luna themes right (it should go white, but it doesn't). Both are insignificant IMHO, as it still looks decent with the grayish background.

Date:

2004-07-03

Author:

Ben Vanik (noxa)
Source code terms of use:
  • Do not re-release and claim as your own (come on... that's just lame).
  • Send any improvements or modifications back to me (you can choose whether to have them posted here or not).
  • If you use the controls or code in your application, add a link back here in your about box/documentation.

My terms are easy - if you don't like them, then don't use my stuff :)

Date:

2004-07-03

Author:

Ben Vanik (noxa)
Todo:
  • Allow selection via tab key.
  • Navigation via keyboard when selected (like TabControl).
  • Improve redraw logic (sometimes areas aren't invalidated properly).
  • Better design time support ('Add tab' tab displayed on control itself).
  • Draw background as white when in Win2k/classic mode.
  • Maybe: allow for system-skinning (blue on Luna, etc).

If anyone implements these features, please send me a copy of the updates!