HeaderPane
Main
Hide
Share Link
Print

SftDateScalingConstants

DPI scaling constants.

NameValueDescription
scalingSftDateAsIs0As is (native size) - the default
scalingSftDateStretch1Stretch (scale by DPI)

Examples

C# View entire sample code

                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;
                c.Value = now;

VB.NET View entire sample code

            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
                           c.Value = current

C++ View entire sample code

        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 | ImageScaling | Per-Monitor DPI and Scaling


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.