High contrast constants.
| Name | Value | Description |
|---|---|---|
| highContrastSftDateOff | 0 | Off (ignore Windows high contrast) - the default |
| highContrastSftDateOn | 1 | On (always use the system palette) |
| highContrastSftDateAuto | 2 | Automatic (follow Windows setting) |
fieldDate, fieldLongDate, fieldTimeList, fieldTimeClock, fieldDateTime,
fieldRange, fieldOptional, fieldEmpty, fieldFreeForm, fieldCustom,
};
// the fields' formats and buttons were set at design time; these follow Windows
DateTime now = DateTime.Now;
ForEachControl(f => {
f.DarkMode = SftDateDarkModeConstants.darkSftDateAuto;
f.HighContrastMode = SftDateHighContrastConstants.highContrastSftDateAuto;
f.ImageScaling = SftDateScalingConstants.scalingSftDateStretch;
if (f != fieldEmpty && f != fieldRange)
f.Value = now;
}, c => {
c.DarkMode = SftDateDarkModeConstants.darkSftDateAuto;
c.HighContrastMode = SftDateHighContrastConstants.highContrastSftDateAuto;
c.ImageScaling = SftDateScalingConstants.scalingSftDateStretch;
fieldDate, fieldLongDate, fieldTimeList, fieldTimeClock, fieldDateTime,
fieldRange, fieldOptional, fieldEmpty, fieldFreeForm, fieldCustom
}
' the fields' formats and buttons were set at design time; these follow Windows
Dim current As Date = Date.Now
ForEachControl(Sub(f)
f.DarkMode = SftDateDarkModeConstants.darkSftDateAuto
f.HighContrastMode = SftDateHighContrastConstants.highContrastSftDateAuto
f.ImageScaling = SftDateScalingConstants.scalingSftDateStretch
If f IsNot fieldEmpty AndAlso f IsNot fieldRange Then f.Value = current
End Sub,
Sub(c)
c.DarkMode = SftDateDarkModeConstants.darkSftDateAuto
c.HighContrastMode = SftDateHighContrastConstants.highContrastSftDateAuto
c.ImageScaling = SftDateScalingConstants.scalingSftDateStretch
for (int i = 0; i < FIELDS; ++i)
m_Fields[i] = GetDlgItem(g_fieldIds[i])->GetControlUnknown();
m_Calendar = GetDlgItem(IDC_CALENDAR)->GetControlUnknown();
// the fields' formats and buttons were set at design time (in the dialog resource); these follow Windows
DATE now = Now();
ForEachControl([&](auto& ctl) {
ctl->DarkMode = darkSftDateAuto;
ctl->HighContrastMode = highContrastSftDateAuto;
ctl->ImageScaling = scalingSftDateStretch;
});
for (int i = 0; i < FIELDS; ++i)
if (g_fieldIds[i] != IDC_EMPTY && g_fieldIds[i] != IDC_RANGE)
m_Fields[i]->Value = _variant_t(now, VT_DATE);
m_Calendar->Value = _variant_t(now, VT_DATE);
m_Fields[IDC_RANGE - IDC_DATE]->SetRange(_variant_t(now, VT_DATE), _variant_t(now + 6, VT_DATE));See Also Object Hierarchy | HighContrastMode | High Contrast