Defines the dark mode setting (off, on, or following the Windows setting).
Get
| C# | SftBoxDarkModeConstants Mode = object.DarkMode; |
| VB.NET | Mode = object.DarkMode As SftBoxDarkModeConstants |
| C++ | enum SftBoxDarkModeConstants Mode = object->DarkMode; enum SftBoxDarkModeConstants Mode = object->GetDarkMode(); |
| C | HRESULT object->get_DarkMode(enum SftBoxDarkModeConstants* Mode); |
Put
| C# | SftBoxDarkModeConstants object.DarkMode = Mode; |
| VB.NET | object.DarkMode = Mode As SftBoxDarkModeConstants |
| C++ | enum SftBoxDarkModeConstants object->DarkMode = Mode; void object->PutDarkMode(enum SftBoxDarkModeConstants Mode); |
| C | HRESULT object->put_DarkMode(enum SftBoxDarkModeConstants Mode); |
object
Mode
Defines the dark mode setting (off, on, or following the Windows setting).
| Name | Value | Description |
|---|---|---|
| darkSftBoxOff | 0 | Always light (the default). |
| darkSftBoxOn | 1 | Always dark. |
| darkSftBoxAuto | 2 | Follow the Windows dark mode setting. |
The DarkMode property defines the dark mode setting (off, on, or following the Windows setting).
When set to darkSftBoxAuto, the control follows the Windows "Choose your mode" setting and re-renders automatically when it changes; the DarkModeChange event is raised when the effective state changes.
Use DarkModeActive to determine whether dark mode is currently active.
AddColor(box, "Background color of ToolTips", Color.FromKnownColor(KnownColor.Info));
}
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;
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)
BOOL CColorsDlg::OnInitDialog()
{
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 iconSee Also SftBox Object | Object Hierarchy | Dark Mode