HeaderPane
Main
Hide
Share Link
Print

DropDownOpening Event, SftDate Object

The dropdown is about to open.

Syntax

C#void object_DropDownOpening(object sender, AxSftDateLib20._ISftDateEvents_DropDownOpeningEvent e);
VB.NETPrivate Sub object_DropDownOpening(ByVal sender As Object, ByVal e As AxSftDateLib20._ISftDateEvents_DropDownOpeningEvent) Handles object.DropDownOpening
C++void OnDropDownOpeningobject(VARIANT_BOOL* Cancel);
CHRESULT OnDropDownOpeningobject(VARIANT_BOOL* Cancel);

object

A SftDate object.

Cancel

Set to True to keep the dropdown closed.

Comments

The DropDownOpening event occurs when the dropdown is about to open, by the user or the OpenDropDown method. The application can prepare the dropdown calendar, for example by adding special dates, or cancel it. p DropDownOpened follows once the dropdown is open.

Examples

C# View entire sample code

        }

        private void field_TextParsing(object sender, _ISftDateEvents_TextParsingEvent e) {
            LogEvent(sender, "TextParsing", "Text=" + e.text + " Current=" + FormatDate(e.current) + " Handled=" + e.handled + " Value=" + FormatDate(e.value));
        }

        private void field_DropDownOpening(object sender, _ISftDateEvents_DropDownOpeningEvent e) {
            // e.cancel = true would keep the dropdown closed
            LogEvent(sender, "DropDownOpening", "Cancel=" + e.cancel);
        }

        private void field_DropDownOpened(object sender, EventArgs e) {
            LogEvent(sender, "DropDownOpened");
        }

        private void field_DropDownClosed(object sender, EventArgs e) {

VB.NET View entire sample code

        LogEvent(sender, If(e.cancel, "ValueValidating (canceled, a weekend)", "ValueValidating"),
            "NewValue=" & FormatDate(e.newValue) & " NewRangeEnd=" & FormatDate(e.newRangeEnd) & " Cancel=" & e.cancel)
    End Sub

    Private Sub field_TextParsing(sender As Object, e As _ISftDateEvents_TextParsingEvent) Handles fieldAppointment.TextParsing
        LogEvent(sender, "TextParsing", "Text=" & e.text & " Current=" & FormatDate(e.current) & " Handled=" & e.handled & " Value=" & FormatDate(e.value))
    End Sub

    Private Sub field_DropDownOpening(sender As Object, e As _ISftDateEvents_DropDownOpeningEvent) Handles fieldAppointment.DropDownOpening, fieldDueDate.DropDownOpening
        ' e.cancel = True would keep the dropdown closed
        LogEvent(sender, "DropDownOpening", "Cancel=" & e.cancel)
    End Sub

    Private Sub field_DropDownOpened(sender As Object, e As EventArgs) Handles fieldAppointment.DropDownOpened, fieldDueDate.DropDownOpened
        LogEvent(sender, "DropDownOpened")
    End Sub

C++ View entire sample code

// The fields and the calendar share their event dispids, so each event has one handler for all three controls; MFC passes the
// control ID first (the leading VTS_I4).
BEGIN_EVENTSINK_MAP(CMainDlg, CDialog)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 1 /* ValueChanged */, OnValueChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 2 /* RangeChanged */, OnRangeChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 3 /* ValueValidating */, OnValueValidating, VTS_I4 VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 4 /* TextParsing */, OnTextParsing, VTS_I4 VTS_BSTR VTS_VARIANT VTS_PBOOL VTS_PVARIANT)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 5 /* DropDownOpening */, OnDropDownOpening, VTS_I4 VTS_PBOOL)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 6 /* DropDownOpened */, OnDropDownOpened, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 7 /* DropDownClosed */, OnDropDownClosed, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 9 /* DateActivated */, OnDateActivated, VTS_I4 VTS_DATE)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 10 /* ViewChanged */, OnViewChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 11 /* DisplayChanged */, OnDisplayChanged, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 12 /* TodayClicked */, OnTodayClicked, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 13 /* ClearClicked */, OnClearClicked, VTS_I4)
    ON_EVENT_RANGE(CMainDlg, IDC_APPOINTMENT, IDC_CALENDAR, 14 /* DarkModeChange */, OnDarkModeChange, VTS_I4 VTS_BOOL)

See Also SftDate Object | Object Hierarchy | The Dropdown


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