HeaderPane
Main
Hide
Share Link
Print

Buttons

Defines the buttons shown in a date field control.

C

int WINAPI SftDate_GetButtons(HWND hwndCtl);
BOOL WINAPI SftDate_SetButtons(HWND hwndCtl, int buttons);

C++

int CSftDate::GetButtons() const;
BOOL CSftDate::SetButtons(int buttons);

Parameters

hwndCtl

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

buttons

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

SFTDATE_BUTTONS_DROPDOWNA dropdown button, which opens the dropdown. This is the default.
SFTDATE_BUTTONS_UPDOWNUp/down (spin) buttons, which increase and decrease the selected part.
SFTDATE_BUTTONS_DROPDOWNANDUPDOWNBoth.
SFTDATE_BUTTONS_NONENo buttons.

Returns

GetButtons returns the buttons, one of the values listed above.

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

Comments

The GetButtons and SetButtons functions define and retrieve the buttons of a date field control.

With SFTDATE_BUTTONS_NONE, the dropdown still opens using Alt+Down, F4 or OpenDropDown. With SFTDATE_BUTTONS_UPDOWN, the field has no dropdown. The up/down buttons repeat while they are held down; the Up and Down arrow keys do the same.

The Clear button is defined using SetShowClearButton, the check box using SetShowCheckBox. This function applies to the date field control only. For a month calendar control, GetButtons returns SFTDATE_BUTTONS_DROPDOWN and SetButtons has no effect and returns FALSE.

Examples

C View entire sample code

        }
        break;
    case IDC_HIGHCONTRAST:
        for (i = 0; i < CONTROLS; ++i)
            SftDate_SetHighContrastMode(c[i], sel);
        break;
    case IDC_BUTTONS:
        for (i = 0; i < FIELDS; ++i)
            SftDate_SetButtons(c[i], sel);
        break;
    case IDC_BORDER:
        for (i = 0; i < FIELDS; ++i)
            SftDate_SetBorderStyle(c[i], g_borderStyles[sel]);
        break;
    case IDC_ALIGNMENT:
        for (i = 0; i < FIELDS; ++i)

C++ View entire sample code

        }
        break;
    case IDC_HIGHCONTRAST:
        for (int i = 0; i < CONTROLS; ++i)
            Control(i).SetHighContrastMode(sel);
        break;
    case IDC_BUTTONS:
        for (int i = 0; i < FIELDS; ++i)
            m_Fields[i].SetButtons(sel);
        break;
    case IDC_BORDER:
        for (int i = 0; i < FIELDS; ++i)
            m_Fields[i].SetBorderStyle(g_borderStyles[sel]);
        break;
    case IDC_ALIGNMENT:
        for (int i = 0; i < FIELDS; ++i)

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


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