Defines the dark mode setting (off, on, or following the Windows setting).
Get
| C# | SftDateDarkModeConstants Mode = object.DarkMode; |
| VB.NET | Mode = object.DarkMode As SftDateDarkModeConstants |
| C++ | enum SftDateDarkModeConstants Mode = object->DarkMode; enum SftDateDarkModeConstants Mode = object->GetDarkMode(); |
| C | HRESULT object->get_DarkMode(enum SftDateDarkModeConstants* Mode); |
Put
| C# | SftDateDarkModeConstants object.DarkMode = Mode; |
| VB.NET | object.DarkMode = Mode As SftDateDarkModeConstants |
| C++ | enum SftDateDarkModeConstants object->DarkMode = Mode; void object->PutDarkMode(enum SftDateDarkModeConstants Mode); |
| C | HRESULT object->put_DarkMode(enum SftDateDarkModeConstants Mode); |
object
Mode
Defines the dark mode setting (off, on, or following the Windows setting).
| Name | Value | Description |
|---|---|---|
| darkSftDateOff | 0 | Off (always light) |
| darkSftDateOn | 1 | On (always dark) |
| darkSftDateAuto | 2 | Automatic (follow Windows setting) |
The DarkMode property defines the dark mode setting of the control (off, on, or following the Windows setting). The default is darkSftDateOff. Dark mode applies to all parts of the control, including the dropdown of a date field control. p When set to darkSftDateAuto, 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. p Colors defined by the application (color properties, special dates, the DayFormatting event) are used as given in dark mode too; only the default colors and system colors follow the mode. High contrast mode takes precedence over dark mode (HighContrastMode).
"and the time. The free-form field parses what you type in the selected culture.\r\n\r\n" +
"The options apply to all fields and calendars; the month counts apply to the SftCalendar control.";
// the options start out with the controls' settings
SftDateCalendar cal = sftCalendar.Calendar;
comboCulture.Items.AddRange(cultures);
comboCulture.SelectedIndex = 0;
comboDarkMode.Items.AddRange(new object[] { "Off", "On", "Auto" });
comboDarkMode.SelectedIndex = (int)sftCalendar.DarkMode;
comboHighContrast.Items.AddRange(new object[] { "Off", "On", "Auto" });
comboHighContrast.SelectedIndex = (int)sftCalendar.HighContrastMode;
comboButtons.Items.AddRange(new object[] { "Dropdown", "Up/down", "Dropdown, up/down", "None" });
comboButtons.SelectedIndex = (int)fieldDate.Buttons;
comboBorder.Items.AddRange(new object[] { "Single", "3D", "None" });
comboBorder.SelectedIndex = Math.Max(0, Array.IndexOf(borderStyles, fieldDate.BorderStyle));
comboAlignment.Items.AddRange(new object[] { "Near", "Far" });
"and the time. The free-form field parses what you type in the selected culture." & vbCrLf & vbCrLf &
"The options apply to all fields and calendars; the month counts apply to the SftCalendar control."
' the options start out with the controls' settings
Dim cal As SftDateCalendar = sftCalendar.Calendar
comboCulture.Items.AddRange(cultures)
comboCulture.SelectedIndex = 0
comboDarkMode.Items.AddRange(New Object() {"Off", "On", "Auto"})
comboDarkMode.SelectedIndex = CInt(sftCalendar.DarkMode)
comboHighContrast.Items.AddRange(New Object() {"Off", "On", "Auto"})
comboHighContrast.SelectedIndex = CInt(sftCalendar.HighContrastMode)
comboButtons.Items.AddRange(New Object() {"Dropdown", "Up/down", "Dropdown, up/down", "None"})
comboButtons.SelectedIndex = CInt(fieldDate.Buttons)
comboBorder.Items.AddRange(New Object() {"Single", "3D", "None"})
comboBorder.SelectedIndex = Math.Max(0, Array.IndexOf(borderStyles, fieldDate.BorderStyle))
comboAlignment.Items.AddRange(New Object() {"Near", "Far"})See Also SftCalendar Object | Object Hierarchy | Dark Mode