HeaderPane
Main
Hide
Share Link
Print

TimeDropDownStyle

Defines how the dropdown of a date field control shows times.

C

int WINAPI SftDate_GetTimeDropDownStyle(HWND hwndCtl);
BOOL WINAPI SftDate_SetTimeDropDownStyle(HWND hwndCtl, int style);

C++

int CSftDate::GetTimeDropDownStyle() const;
BOOL CSftDate::SetTimeDropDownStyle(int style);

Parameters

hwndCtl

The window handle of the date field control (SftDate).

style

The style. style can be one of the following values:

SFTDATE_TIMESTYLE_LISTA list of times, at the interval defined using SetTimeInterval. This is the default.
SFTDATE_TIMESTYLE_CLOCKA clock face on which the user chooses the hour, then the minutes.

Returns

GetTimeDropDownStyle returns the style, one of the values listed above.

SetTimeDropDownStyle returns TRUE if the value is valid, otherwise FALSE.

Comments

The GetTimeDropDownStyle and SetTimeDropDownStyle functions define and retrieve how times are chosen in the dropdown (SetDropDownContent). The list and the clock use the hour format of the field (12 or 24 hours).

A new style closes the dropdown if it is open. This function applies to the date field control only. For a month calendar control, GetTimeDropDownStyle returns SFTDATE_TIMESTYLE_LIST and SetTimeDropDownStyle has no effect and returns FALSE.

Examples

C View entire sample code

    }

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_LONGDATE), SFTDATE_FORMAT_LONGDATE);

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_TIMELIST), SFTDATE_FORMAT_SHORTTIME);
    SftDate_SetTimeInterval(GetDlgItem(hwndDlg, IDC_TIMELIST), 15);

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_TIMECLOCK), SFTDATE_FORMAT_SHORTTIME);
    SftDate_SetTimeDropDownStyle(GetDlgItem(hwndDlg, IDC_TIMECLOCK), SFTDATE_TIMESTYLE_CLOCK);

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_DATETIME), SFTDATE_FORMAT_SHORTDATETIME);

    SftDate_SetSelectionMode(GetDlgItem(hwndDlg, IDC_RANGE), SFTDATE_SELECTION_RANGE);
    SftDate_SetRange(GetDlgItem(hwndDlg, IDC_RANGE), &now, &weekLater);

    SftDate_SetShowCheckBox(GetDlgItem(hwndDlg, IDC_OPTIONAL), TRUE);

C++ View entire sample code

    }

    m_Fields[1].SetFormat(SFTDATE_FORMAT_LONGDATE);

    m_Fields[2].SetFormat(SFTDATE_FORMAT_SHORTTIME);
    m_Fields[2].SetTimeInterval(15);

    m_Fields[3].SetFormat(SFTDATE_FORMAT_SHORTTIME);
    m_Fields[3].SetTimeDropDownStyle(SFTDATE_TIMESTYLE_CLOCK);

    m_Fields[4].SetFormat(SFTDATE_FORMAT_SHORTDATETIME);

    m_Fields[5].SetSelectionMode(SFTDATE_SELECTION_RANGE);
    m_Fields[5].SetRange(&now, &weekLater);

    m_Fields[6].SetShowCheckBox(TRUE);

See Also C/C++ API | Categories | Notifications


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