HeaderPane
Main
Hide

SftTabs/DLL 7.0 Documentation

Share Link
Print

Dark Mode

SftTabs/DLL 7.0 supports dark mode. Users who have selected the Windows 10 "Choose your mode" accessibility setting to Dark will see SftTabs controls rendered with a dark color palette; users who have selected Light see the traditional palette. The tab control follows the system setting automatically - no per-application setup is required.

What changes in dark mode: the tab control background, tab labels, active-tab highlight, scroll buttons and close/minimize/restore buttons all switch to dark-palette colors. Windows themes are suppressed while dark mode is active so the control renders through its built-in dark-aware GDI path rather than the system's light-themed tab style.

The tab control's dark mode setting has three values (see SetDarkMode):

AUTO (default)Follow the Windows "Choose your mode" setting. The control re-renders when the system setting flips.
ONAlways use the dark palette, regardless of the Windows setting. Useful when the hosting application has its own Light / Dark toggle and wants the tab control to follow it.
OFFAlways use the light palette, regardless of the Windows setting. Useful when the application does not yet support dark mode end-to-end and mixing dark and light controls would look wrong.

SFTTABSN_DARKMODE_CHANGED is sent to the parent window each time the active dark mode state flips (AUTO mode only) so the application can repaint its own chrome around the tab control. IsDarkModeActive reports the current state at any time.

Caller-supplied color overrides (SetCtlColors, per-tab colors in SFTTABS_TAB) remain in effect in dark mode unless high contrast mode is also active. If you need specific tabs to stand out in dark mode, pick accent colors that read well on both a light and a dark background (mid-tone saturated values in the RGB 30-210 range tend to work in both).

Owner-drawn tabs (SFTTABS_DRAWTABPROC) are responsible for their own dark-mode compliance. The SFTTABS_DRAWINFO structure carries the tab control's current palette in its colorBg / colorFg members and IsDarkModeActive can be queried if role-specific colors are needed. The default render path handles non-owner-drawn tabs automatically.

Host dialog integration

The tab control follows the dark mode setting at the control level. The hosting dialog itself - title bar, dialog background, static labels, group boxes, edits and any standard Win32 controls placed alongside the tab control - also needs to be wired into dark mode for the dialog to render coherently. The shared SftDarkMode helper provides that integration: a single header (SftDarkMode.h) used by every Softel vdm DLL product that handles dialog title bars, WM_CTLCOLOR* responses, the Windows "Choose your mode" toggle, and dark NC scrollbars on standard controls.

A typical adoption is four call sites: SftDarkMode_Init at process startup, SftDarkMode_ApplyToDialog from each WM_INITDIALOG, SftDarkMode_HandleDialogMessage routed from each dialog procedure, and an optional SftDarkMode_SetActive when the application exposes its own Light / Dark toggle.

Platform note: Dark mode requires Windows 10 or later. On earlier platforms the setting is stored but has no visual effect.


Last Updated 05/09/2026 - (email)
© 2026 Softel vdm, Inc.