High contrast constants.
| Name | Value | Description |
|---|---|---|
| highContrastSftBoxOff | 0 | Off (ignore Windows high contrast) |
| highContrastSftBoxOn | 1 | On (always use the system palette) |
| highContrastSftBoxAuto | 2 | Automatic (follow Windows setting) - the default |
}
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 Object Hierarchy | High Contrast