Defines the high contrast setting (off, on, or following the Windows setting).
Get
| C# | SftMaskHighContrastConstants Mode = object.HighContrastMode; |
| VB.NET | Mode = object.HighContrastMode As SftMaskHighContrastConstants |
| C++ | enum SftMaskHighContrastConstants Mode = object->HighContrastMode; enum SftMaskHighContrastConstants Mode = object->GetHighContrastMode(); |
| C | HRESULT object->get_HighContrastMode(enum SftMaskHighContrastConstants* Mode); |
Put
| C# | SftMaskHighContrastConstants object.HighContrastMode = Mode; |
| VB.NET | object.HighContrastMode = Mode As SftMaskHighContrastConstants |
| C++ | enum SftMaskHighContrastConstants object->HighContrastMode = Mode; void object->PutHighContrastMode(enum SftMaskHighContrastConstants Mode); |
| C | HRESULT object->put_HighContrastMode(enum SftMaskHighContrastConstants Mode); |
object
Mode
Defines the high contrast setting (off, on, or following the Windows setting).
| Name | Value | Description |
|---|---|---|
| highContrastSftMaskOff | 0 | Ignore the Windows High Contrast setting and render normally. |
| highContrastSftMaskOn | 1 | Always use the system palette. |
| highContrastSftMaskAuto | 2 | Follow the Windows High Contrast setting (the default). |
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.
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
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
{
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 iconSee Also SftMask Object | Object Hierarchy | High Contrast