HeaderPane
Main
Hide
Share Link
Print

Dark Mode

SftMask/OCX 8.0 supports dark mode. By default the masked edit control uses the light palette. An application opts in by setting the DarkMode property to darkSftMaskAuto so the control follows the Windows "Choose your mode" setting automatically - users who have selected Dark see a dark color palette and users who have selected Light see the traditional palette, and the control re-renders when the user flips between them. darkSftMaskOn always uses the dark palette regardless of the Windows setting.

What changes in dark mode: the edit area, caption, literals, prompt underlines, buttons (up/down, drop down, ellipse), the error image area and all popup windows - the popup calendar, the popup calculator and the autocomplete window - switch to dark-palette colors.

LightDark

The DarkMode property has three values (see SftMaskDarkModeConstants):

ValueDescription
darkSftMaskAutoFollow the Windows "Choose your mode" setting. The control re-renders when the system setting flips.
darkSftMaskOnAlways 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.
darkSftMaskOff (default)Always 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.

The DarkModeChange event is fired each time the active dark mode state flips (darkSftMaskAuto only) so the application can repaint its own chrome around the masked edit control. The DarkModeActive property reports the current state at any time.

Caller-supplied color overrides (explicit RGB values assigned to color properties such as BackColor and ForeColor, and the selection, caption, calendar and calculator colors) are still honored in dark mode - the control does not override application-chosen colors. If you set explicit colors and also want 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 are drawn by the control itself so they match the dark palette instead of the system's light-themed style (see Using Themes).

Error images are the application's responsibility. An image defined using the ImageInvalid, ImageEmpty or ImageRequired property is drawn as supplied when the palette turns dark.

Dark mode and Windows High Contrast are independent settings. If the user has both enabled, high contrast takes precedence. See High Contrast.

Dark mode requires Windows 10 version 1809 or later, or Windows 11.


Last Updated 11/15/2026 - (email)
© 2026 Softel vdm, Inc.