HeaderPane
Main
Hide
Share Link
Print

SftBoxDarkModeConstants

Dark mode constants.

NameValueDescription
darkSftBoxOff0Off (always light) - the default
darkSftBoxOn1On (always dark)
darkSftBoxAuto2Automatic (follow Windows setting)

Examples

C# View entire sample code

            AddColor(box, "Background color of ToolTips", Color.FromKnownColor(KnownColor.Info));
        }

        private void Form1_Load(object sender, System.EventArgs e)
        {
            foreach (Control c in Controls) {
                AxSftBoxLib60.AxSftBox box = c as AxSftBoxLib60.AxSftBox;
                if (box != null) {
                    box.DarkMode = SftBoxLib60.SftBoxDarkModeConstants.darkSftBoxAuto; // follow the Windows dark mode setting
                    box.HighContrastMode = SftBoxLib60.SftBoxHighContrastConstants.highContrastSftBoxAuto; // follow the Windows High Contrast setting
                }
            }

            int index;
            short column;
    

VB.NET View entire sample code

    AddColor(box, "Background color of ToolTips", Color.FromKnownColor(KnownColor.Info))
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    For Each c As Control In Controls
        Dim box As AxSftBoxLib60.AxSftBox = TryCast(c, AxSftBoxLib60.AxSftBox)
        If box IsNot Nothing Then
            box.DarkMode = SftBoxLib60.SftBoxDarkModeConstants.darkSftBoxAuto ' follow the Windows dark mode setting
            box.HighContrastMode = SftBoxLib60.SftBoxHighContrastConstants.highContrastSftBoxAuto ' follow the Windows High Contrast setting
        End If
    Next

    Dim index As Integer
    Dim column As Short

    AddColors(SftBox1)

C++ View entire sample code

BOOL CColorsDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

    SftDarkMode_ApplyToDialog(m_hWnd);
    for (CWnd* pWnd = GetWindow(GW_CHILD); pWnd != NULL; pWnd = pWnd->GetWindow(GW_HWNDNEXT)) {
        ISftBoxPtr pBox(pWnd->GetControlUnknown());
        if (pBox != NULL) {
            pBox->DarkMode = darkSftBoxAuto;                       // follow the Windows dark mode setting
            pBox->HighContrastMode = highContrastSftBoxAuto;      // follow the Windows High Contrast setting
        }
    }

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon

See Also Object Hierarchy | Dark Mode


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