The problem
The TabControl is fine for a settings dialog with three pages. It runs out quickly when an application uses tabs the way browsers and editors do: documents that open in tabs, tabs the user closes and rearranges, a tab that shows a status image or a progress bar, a look that matches the rest of the application.
The usual answer is owner-drawing: set DrawMode, paint every tab yourself, hit-test your own close glyph, and write the drag code for reordering. It works until the next DPI or theme change. SftTabs/NET 3.0 is a tab control for Windows Forms, written entirely in C#, that has these features built in.
Feature comparison
| Feature | TabControl | SftTabs/NET 3.0 |
|---|---|---|
| Looks | The Windows theme, buttons or flat buttons | Eight: Windows theme, classic 3D, flat, buttons, underline, document, rounded and pills |
| Close button on tabs | No, owner-draw | Yes, always or on the selected or hot tab |
| Tab reordering by the user | No | Yes, by dragging |
| Tab contents | Text and one ImageList image | Text, images, buttons, check boxes, radio buttons and progress bars, in any combination |
| Tab colors | No, owner-draw | Full color support, gradient fills, flyby highlighting |
| Hidden and disabled tabs | No, the tab page has to be removed | Yes |
| Many tabs | Multiple rows or scroll buttons | Multiple rows with several row layouts, or one scrollable row |
| Close, Minimize and Restore buttons | No | Yes |
| Tooltips | For tabs | For tabs and buttons |
| Tabs without pages | No | Yes, use just the row of tabs |
What the code looks like
If you know the TabControl, SftTabs/NET will look familiar: tabs have pages, and pages hold your controls. This adds a tab with a close button and removes it when the button is clicked:
sftTabs1.Look = TabLookEnum.Document;
sftTabs1.AllowReordering = true;
TabClass tab = sftTabs1.Tabs.Add("Report.pdf");
tab.CloseButton = TabCloseButtonOptionalEnum.Always;
tab.Page.Controls.Add(viewer);
tab.Select();
private void sftTabs1_TabCloseButtonClicked(object sender, TabEventArgs e) {
e.Tab.Remove();
}
You can also skip the code: the control is placed from the Visual Studio toolbox, and its property pages let you design the tabs visually.
Modern Windows
SftTabs/NET 3.0 runs in .NET Framework 4.7 (or later) and .NET 10 (or later) applications, with the same API and Visual Studio designer support in both. Set one property and it follows the Windows light/dark setting. It scales with the DPI of the monitor showing it, honors the Windows contrast themes and has built-in UI Automation support for Narrator, NVDA, JAWS and other screen readers.
When the TabControl is enough
If a dialog has a few fixed pages and the standard look suits your application, the TabControl is fine, and it is free. SftTabs/NET earns its place when users open, close and rearrange tabs, when tabs carry more than a caption, or when the tabs should look like the rest of your application.
Try it
The free trial includes the working control and the C# and VB.NET samples. Test it in your own forms before you buy. A license is royalty-free and includes one year of support and upgrades.
