HeaderPane
Main
Hide

SftButton/OCX 4.0 - ActiveX Button Control

Share Link
Print

Dark Mode

SftButton/OCX 4.0 supports dark mode. By default the button control uses the light palette. An application opts in by setting the DarkMode property to darkSftButtonAuto 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. darkSftButtonOn always uses the dark palette regardless of the Windows setting.

What changes in dark mode: the button face, caption text, border and edge lines, the drop-down button and its arrow, and the hover, pressed and disabled appearances all switch to dark-palette colors. Images supplied by the application are drawn unchanged - see below.

The DarkMode property has three values (see SftButtonDarkModeConstants):

ValueDescription
darkSftButtonAutoFollow the Windows "Choose your mode" setting. The control re-renders when the system setting flips.
darkSftButtonOnAlways use the dark palette, regardless of the Windows setting. Useful when the hosting application has its own Light / Dark toggle and wants the button to follow it.
darkSftButtonOff (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 (darkSftButtonAuto only) so the application can repaint its own chrome around the button control. The DarkModeActive property reports the current state at any time.

Caller-supplied color overrides (BackColor, ForeColor, the gradient and hover colors, and the edge 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).

Images are the application's responsibility. A button whose image was drawn for a light background will still be drawn as supplied when the palette turns dark. Where that matters, supply artwork that reads on both palettes, or switch images when the DarkModeChange event reports a change.

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


Last Updated 08/02/2026 - (email)
© 2026 Softel vdm, Inc.