HeaderPane
Main
Hide
Share Link
Print

CalendarClearButton

Defines whether the Clear button is shown below the months.

C

BOOL WINAPI SftDate_GetCalendarClearButton(HWND hwndCtl);
void WINAPI SftDate_SetCalendarClearButton(HWND hwndCtl, BOOL fShow);

C++

BOOL CSftDate::GetCalendarClearButton() const;
BOOL CSftCalendar::GetCalendarClearButton() const;
void CSftDate::SetCalendarClearButton(BOOL fShow);
void CSftCalendar::SetCalendarClearButton(BOOL fShow);

Parameters

hwndCtl

The window handle of the month calendar control (SftCalendar), or of the date field control (SftDate) whose dropdown calendar is affected.

fShow

TRUE if the Clear button is shown below the months, otherwise FALSE.

Returns

GetCalendarClearButton returns TRUE if the Clear button is shown below the months, otherwise FALSE.

Comments

The GetCalendarClearButton and SetCalendarClearButton functions define and retrieve whether the Clear button is shown below the months. The default is FALSE.

Clicking the Clear button in a month calendar control removes the selected date or range and sends the NM_SFTDATE_CLEARCLICKED notification. In a date field control's dropdown calendar, the Clear button closes the dropdown and empties the field, if it allows an empty value (SetAllowEmpty) or has a check box (SetShowCheckBox).

The button's text is defined using SetCalendarClearText. The date field control's own Clear button is defined using SetShowClearButton.

The setting applies to a month calendar control and to the dropdown calendar of a date field control.

Examples

C View entire sample code

            SftDate_SetShowTodayButton(c[i], fChecked);
        break;
    case IDC_HIGHLIGHTTODAY:
        for (i = 0; i < CONTROLS; ++i)
            SftDate_SetHighlightToday(c[i], fChecked);
        break;
    case IDC_CLEARBUTTON:
        for (i = 0; i < CONTROLS; ++i)
            SftDate_SetCalendarClearButton(c[i], fChecked);
        break;
    case IDC_HOLIDAYS:
        SetHolidays(c, fChecked);
        break;
    case IDC_WEEKENDS:
        // NM_SFTDATE_DAYFORMATTING colors the days; RefreshDays asks for them again
        for (i = 0; i < CONTROLS; ++i)

C++ View entire sample code

            Control(i).SetShowTodayButton(fChecked);
        break;
    case IDC_HIGHLIGHTTODAY:
        for (int i = 0; i < CONTROLS; ++i)
            Control(i).SetHighlightToday(fChecked);
        break;
    case IDC_CLEARBUTTON:
        for (int i = 0; i < CONTROLS; ++i)
            Control(i).SetCalendarClearButton(fChecked);
        break;
    case IDC_HOLIDAYS:
        SetHolidays(fChecked);
        break;
    case IDC_WEEKENDS:
        // NM_SFTDATE_DAYFORMATTING colors the days; RefreshDays asks for them again
        for (int i = 0; i < CONTROLS; ++i)

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


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