HeaderPane
Main
Hide
Share Link
Print

Dark Mode

SftBox/OCX 6.0 supports dark mode. By default the combo box control uses the light palette. An application opts in by setting the DarkMode property to darkSftBoxAuto 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. darkSftBoxOn always uses the dark palette regardless of the Windows setting.

What changes in dark mode: the static portion, the edit control portion, the drop down portion with its items, grid lines, selection, column headers and row headers, the border, the drop down button and the scroll bars all switch to dark-palette colors.

LightDark

The DarkMode property has three values (see SftBoxDarkModeConstants):

ValueDescription
darkSftBoxAutoFollow the Windows "Choose your mode" setting. The control re-renders when the system setting flips.
darkSftBoxOnAlways 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.
darkSftBoxOff (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 (darkSftBoxAuto only) so the application can repaint its own chrome around the combo box control. The DarkModeActive property reports the current state at any time.

Colors defined by the application (explicit RGB values assigned to color properties such as Items.BackColor, and the column, cell and row header colors) are still honored in dark mode - the control does not override application-chosen colors. Only the default colors, which are based on Windows system colors, are replaced by their dark-palette counterparts. 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), or define the colors again when the DarkModeChange event is fired.

If Windows themes are used (see Using Themes), the border and the drop down button are drawn using the dark variant of the Windows theme while dark mode is active.

Pictures are the application's responsibility. Item, cell, header and drop down button pictures are 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/22/2026 - (email)
© 2026 Softel vdm, Inc.