HeaderPane
Main
Hide
Share Link
Print

HighContrastMode Property, SftMask Object

Defines the high contrast setting (off, on, or following the Windows setting).

Syntax

Get

C#SftMaskHighContrastConstants Mode = object.HighContrastMode;
VB.NETMode = object.HighContrastMode As SftMaskHighContrastConstants
C++enum SftMaskHighContrastConstants Mode = object->HighContrastMode;
enum SftMaskHighContrastConstants Mode = object->GetHighContrastMode();
CHRESULT object->get_HighContrastMode(enum SftMaskHighContrastConstants* Mode);

Put

C#SftMaskHighContrastConstants object.HighContrastMode = Mode;
VB.NETobject.HighContrastMode = Mode As SftMaskHighContrastConstants
C++enum SftMaskHighContrastConstants object->HighContrastMode = Mode;
void object->PutHighContrastMode(enum SftMaskHighContrastConstants Mode);
CHRESULT object->put_HighContrastMode(enum SftMaskHighContrastConstants Mode);

object

A SftMask object.

Mode

Defines the high contrast setting (off, on, or following the Windows setting).

NameValueDescription
highContrastSftMaskOff0Ignore the Windows High Contrast setting and render normally.
highContrastSftMaskOn1Always use the system palette.
highContrastSftMaskAuto2Follow the Windows High Contrast setting (the default).

Comments

The HighContrastMode property defines the high contrast setting (off, on, or following the Windows setting).

When set to highContrastSftMaskAuto, the control follows the Windows High Contrast accessibility setting and re-renders automatically; the HighContrastChange event is raised when the effective state changes.

Use HighContrastActive to determine whether high contrast is currently active.

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

    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
    SftMaskToday.Contents.DateTime = Today ' set today's date

C++ View entire sample code

{
	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
	SetIcon(m_hIcon, FALSE);		// Set small icon

See Also SftMask Object | Object Hierarchy | High Contrast


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