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