HeaderPane
Main
Hide
Share Link
Print

DropDownAlignment

Defines the edge of a date field control the dropdown aligns with.

C

int WINAPI SftDate_GetDropDownAlignment(HWND hwndCtl);
BOOL WINAPI SftDate_SetDropDownAlignment(HWND hwndCtl, int alignment);

C++

int CSftDate::GetDropDownAlignment() const;
BOOL CSftDate::SetDropDownAlignment(int alignment);

Parameters

hwndCtl

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

alignment

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

SFTDATE_ALIGN_NEARThe dropdown aligns with the leading edge of the field (the left edge, or the right edge if the field is laid out from right to left). This is the default.
SFTDATE_ALIGN_FARThe dropdown aligns with the trailing edge of the field.

Returns

GetDropDownAlignment returns the alignment, one of the values listed above.

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

Comments

The GetDropDownAlignment and SetDropDownAlignment functions define and retrieve how the dropdown is placed below the field. A dropdown that doesn't fit on the monitor below the field opens above it and is moved horizontally to stay on the monitor.

The reading order is defined using SetRightToLeft. This function applies to the date field control only. For a month calendar control, GetDropDownAlignment returns SFTDATE_ALIGN_NEAR and SetDropDownAlignment has no effect and returns FALSE.

Examples

C View entire sample code

            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)
            SftDate_SetDropDownAlignment(c[i], sel);
        break;
    case IDC_ACROSS:
        SftDate_SetMonthsAcross(hwndCal, sel + 1);
        break;
    case IDC_DOWN:
        SftDate_SetMonthsDown(hwndCal, sel + 1);
        break;

C++ View entire sample code

            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)
            m_Fields[i].SetDropDownAlignment(sel);
        break;
    case IDC_ACROSS:
        m_Calendar.SetMonthsAcross(sel + 1);
        break;
    case IDC_DOWN:
        m_Calendar.SetMonthsDown(sel + 1);
        break;

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


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