SftButton/DLL 3.0 - Button Control
SftTree/DLL 8.0 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 4.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 8.0 - Tree Control
SftButton/DLL 3.0 - Button Control
SftTree/DLL 8.0 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 4.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 8.0 - Tree Control
SftTree/NET 2.0 - Tree Control
SftMask/DLL 7.0 supports dark mode. The default for new controls is SFTMASK_DARKMODE_OFF (always light) to preserve visual back-compatibility for applications written before dark mode existed. Applications that want their masked edit controls to follow the Windows "Choose your mode" setting should call SetDarkMode with SFTMASK_DARKMODE_AUTO once at control creation, or maintain their own Light / Dark toggle and switch each control to ON / OFF as the toggle changes.
What changes in dark mode: the edit area, caption, literals, prompt underlines, buttons (up-down, drop down, ellipse), error image area and all popup windows - the popup calendar, the popup calculator and the autocomplete window - switch to dark-palette colors. Theme-driven chrome is suppressed while dark mode is active so that the control matches the dark palette instead of the system's light-themed edit field style.
The masked edit control's dark mode setting has three values (see SetDarkMode):
| OFF (default) | Always use the light palette, regardless of the Windows setting. Preserves visual back-compatibility for applications written before dark mode existed. |
| ON | Always use the dark palette, regardless of the Windows setting. Useful when the hosting application has its own Light / Dark toggle and wants the control to follow it. |
| AUTO | Follow the Windows "Choose your mode" setting. The control re-renders when the system setting flips and sends SFTMASKN_DARKMODE_CHANGED to the parent window. |
SFTMASKN_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 masked edit control. IsDarkModeActive reports the current state at any time; the read-only fDarkModeActive field of the SFTMASK_CONTROL structure reports the same state.
Caller-supplied color overrides (explicit RGB values for background, foreground, selection, caption, calendar and calculator colors) are still honored in dark mode - the control does not override application-chosen colors. If you need specific controls 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).
Windows themes are suppressed while dark mode is active. The control's edit field frame and buttons fall back to the control's built-in dark-aware GDI rendering path so they match the dark palette instead of the system's light-themed style.
Dark mode and Windows High Contrast are independent. If the user has both enabled, high contrast takes precedence (see High Contrast).
Dark mode requires Windows 10 or later. On earlier platforms the setting is stored but has no visual effect.
See Also SetDarkMode | GetDarkMode | IsDarkModeActive | High Contrast | Using Themes
