HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

SFTBUTTON_DARKMODE Constants

The SFTBUTTON_DARKMODE constants describe whether the button control participates in Windows dark mode. They are stored in SFTBUTTON_CONTROL.nDarkMode and are passed to and returned by SetDarkMode / GetDarkMode.

SFTBUTTON_DARKMODE_OFF (0)Always use the light palette, regardless of the Windows setting. This is the default.
SFTBUTTON_DARKMODE_ON (1)Always use the dark palette, regardless of the Windows setting.
SFTBUTTON_DARKMODE_AUTO (2)Follow the Windows "Choose your mode" setting. The control re-renders automatically when the Windows setting flips and sends SFTBUTTONN_DARKMODE_CHANGED to its parent.

Caller-supplied color overrides remain in effect in every mode. Dark mode does not override per-state background, gradient, text or border colors set by the application.

Examples

C

        // Apply dark mode to dialog
        SftDarkMode_ApplyToDialog(hwndDlg);

        // Configure SftButton control 1
        {
            SFTBUTTON_CONTROL Ctl;
            Ctl.cbSize = sizeof(SFTBUTTON_CONTROL);
            SftButton_GetControlInfo(hwndButton1, &Ctl);
            Ctl.nDarkMode = SFTBUTTON_DARKMODE_AUTO;/* automatic dark mode support */
            SftButton_SetControlInfo(hwndButton1, &Ctl);
        }

        // Configure SftButton control 2
        {
            SFTBUTTON_CONTROL Ctl;
            Ctl.cbSize = sizeof(SFTBUTTON_CONTROL);

See Also SetDarkMode | GetDarkMode | IsDarkModeActive | Dark Mode | SFTBUTTON_HIGHCONTRAST


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