HeaderPane
Main
Hide
Share Link
Print

HighContrastMode Property, SftBox Object

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

Syntax

Get

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

Put

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

object

A SftBox object.

Mode

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

NameValueDescription
highContrastSftBoxOff0Ignore the Windows High Contrast setting and render normally.
highContrastSftBoxOn1Always use the system palette.
highContrastSftBoxAuto2Follow 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 highContrastSftBoxAuto, 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) {
                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;
    
            AddColors(SftBox1);

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

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

See Also SftBox Object | Object Hierarchy | High Contrast


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