HeaderPane
Main
Hide
Share Link
Print

DropOnFocus

Defines whether the dropdown opens when a date field control receives the input focus.

C

BOOL WINAPI SftDate_GetDropOnFocus(HWND hwndCtl);
void WINAPI SftDate_SetDropOnFocus(HWND hwndCtl, BOOL fDrop);

C++

BOOL CSftDate::GetDropOnFocus() const;
void CSftDate::SetDropOnFocus(BOOL fDrop);

Parameters

hwndCtl

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

fDrop

TRUE to open the dropdown when the field receives the input focus, otherwise FALSE.

Returns

GetDropOnFocus returns TRUE if the dropdown opens on focus, otherwise FALSE.

Comments

The GetDropOnFocus and SetDropOnFocus functions define and retrieve whether the dropdown of a date field control opens as soon as the field receives the input focus, by keyboard or mouse. The default is FALSE.

When the field is entered with a click, the dropdown opens once the mouse button is released, so the click doesn't close it again. The dropdown doesn't open if the field is disabled, has no dropdown (SFTDATE_BUTTONS_UPDOWN, see SetButtons) or the application cancels it (NM_SFTDATE_DROPDOWNOPENING). This function applies to the date field control only. For a month calendar control, GetDropOnFocus returns FALSE and SetDropOnFocus has no effect.

Examples

C View entire sample code

            SftDate_SetMinDate(c[i], fChecked ? &first : &g_minDate);
            SftDate_SetMaxDate(c[i], fChecked ? &last : &g_maxDate);
        }
        ShowSelection(hwndDlg);
        break;
     }
    case IDC_DROPONFOCUS:
        for (i = 0; i < FIELDS; ++i)
            SftDate_SetDropOnFocus(c[i], fChecked);
        break;
    case IDC_AUTOADVANCE:
        for (i = 0; i < FIELDS; ++i)
            SftDate_SetAutoAdvance(c[i], fChecked);
        break;
    case IDC_COLORS:
        for (i = 0; i < CONTROLS; ++i)

C++ View entire sample code

            Control(i).SetMinDate(fChecked ? &first : &m_minDate);
            Control(i).SetMaxDate(fChecked ? &last : &m_maxDate);
        }
        ShowSelection();
        break;
     }
    case IDC_DROPONFOCUS:
        for (int i = 0; i < FIELDS; ++i)
            m_Fields[i].SetDropOnFocus(fChecked);
        break;
    case IDC_AUTOADVANCE:
        for (int i = 0; i < FIELDS; ++i)
            m_Fields[i].SetAutoAdvance(fChecked);
        break;
    case IDC_COLORS:
        for (int i = 0; i < CONTROLS; ++i)

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


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