HeaderPane
Main
Hide
Share Link
Print

SftMaskDarkModeConstants

Dark mode constants.

NameValueDescription
darkSftMaskOff0Off (always light) - the default
darkSftMaskOn1On (always dark)
darkSftMaskAuto2Automatic (follow Windows setting)

Examples

C# View entire sample code

        private void Form1_Load(object sender, System.EventArgs e)
        {
            foreach (Control c in Controls) {
                AxSftMaskLib80.AxSftMask mask = c as AxSftMaskLib80.AxSftMask;
                if (mask != null) {
                    mask.DarkMode = SftMaskLib80.SftMaskDarkModeConstants.darkSftMaskAuto; // follow the Windows dark mode setting
                    mask.HighContrastMode = SftMaskLib80.SftMaskHighContrastConstants.highContrastSftMaskAuto; // follow the Windows High Contrast setting
                }
            }

            SftMaskPhone.Text = "9415058600"; // our phone number
            SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome; // set the input location
            SftMaskSSN.Text = "444-12-1111"; // a social security number
            SftMaskToday.Contents.DateTime = System.DateTime.Now; // set today's date
            SftMaskTime.Contents.DateTime = System.DateTime.Now;
            SftMaskPercent.Contents.set_Value(0, 50); // start with 50 percent

VB.NET View entire sample code

Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
    End
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 mask As AxSftMaskLib80.AxSftMask = TryCast(c, AxSftMaskLib80.AxSftMask)
        If mask IsNot Nothing Then
            mask.DarkMode = SftMaskLib80.SftMaskDarkModeConstants.darkSftMaskAuto ' follow the Windows dark mode setting
            mask.HighContrastMode = SftMaskLib80.SftMaskHighContrastConstants.highContrastSftMaskAuto ' follow the Windows High Contrast setting
        End If
    Next

    SftMaskPhone.Text = "9415058600" ' our phone number
    SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome ' set the input location
    SftMaskSSN.Text = "444-12-1111" ' a social security number

C++ View entire sample code

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

    SftDarkMode_ApplyToDialog(m_hWnd);
    for (CWnd* pWnd = GetWindow(GW_CHILD); pWnd != NULL; pWnd = pWnd->GetWindow(GW_HWNDNEXT)) {
        ISftMaskPtr pMask(pWnd->GetControlUnknown());
        if (pMask != NULL) {
            pMask->DarkMode = darkSftMaskAuto;                      // follow the Windows dark mode setting
            pMask->HighContrastMode = highContrastSftMaskAuto;     // 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/15/2026 - (email)
© 2026 Softel vdm, Inc.