HeaderPane
Main
Hide
Share Link
Print

DropHighlightStyle

Defines the display attribute of the current drag & drop target item.

C

DWORD WINAPI SftBox_GetDropHighlightStyle(HWND hwndCtl);
void WINAPI SftBox_SetDropHighlightStyle(HWND hwndCtl, DWORD style);

C++

DWORD CSftBox::GetDropHighlightStyle() const;
void CSftBox::SetDropHighlightStyle(DWORD style);

Parameters

hwndCtl

The window handle of the combo box control.

style

A value describing the display method used for the current drag & drop target item in the dropdown portion, defined using SetDropHighlight:

SFTBOX_DROPHIGHLIGHT_ONTOPThe drag & drop target item is highlighted using the color defined by the SFTBOX_COLORS structure member colorDropHighlight (see SetCtlColors). A rectangle is drawn around the target item using this color. If outline selection is in use (SFTBOX_SELECTION_OUTLINE, see SetSelectionStyle), the target item is drawn with an outline instead, using the SFTBOX_COLORS members droptargetOutlineBorder, droptargetInnerBorder, droptargetInnerFill1 and droptargetInnerFill2.
SFTBOX_DROPHIGHLIGHT_BETWEENThe drag & drop target is highlighted using a solid line drawn using the color defined by the SFTBOX_COLORS structure member colorDropHighlight (see SetCtlColors). The line is drawn before the target item, interpreting the value returned by GetDropHighlight as the insertion point.

Returns

GetDropHighlightStyle returns a value indicating the current drop target display method.

Comments

The GetDropHighlightStyle and SetDropHighlightStyle functions define the display attribute of the current drag & drop target item.

The drop target item is defined using SetDropHighlight, usually while handling the SFTBOXN_DRAGGING notification. The selected item (see GetCurSel) is not changed by the drop target.

If a value other than SFTBOX_DROPHIGHLIGHT_ONTOP or SFTBOX_DROPHIGHLIGHT_BETWEEN is specified, SetDropHighlightStyle is ignored.

When a combo box is created, the drop highlight style is SFTBOX_DROPHIGHLIGHT_ONTOP.

Drag & drop support for the dropdown portion is enabled using SetDragType.

Examples

C View entire sample code

static void InitList(HWND hwndBox, LPCTSTR * alpszItems, int count)
{
    int i;

    // Items can be dragged from the list, selected text from the edit portion
    SftBox_SetDragType(hwndBox, SFTBOX_DRAG_EDITDROPDOWN);
    // A line between items shows where a dragged item will be inserted
    SftBox_SetDropHighlightStyle(hwndBox, SFTBOX_DROPHIGHLIGHT_BETWEEN);
    SftBox_SetDarkMode(hwndBox, SFTBOX_DARKMODE_AUTO);

    for (i = 0 ; i < count ; ++i)
        SftBox_AddString(hwndBox, alpszItems[i]);
    if (count > 0)
        SftBox_SetCurSel(hwndBox, 0);
}

C++ View entire sample code

    DDX_Control(pDX, IDC_SELECTED, m_Selected);
}

void CMainDlg::InitList(CSftBox& box, LPCTSTR* alpszItems, int count)
{
    // Items can be dragged from the list, selected text from the edit portion
    box.SetDragType(SFTBOX_DRAG_EDITDROPDOWN);
    // A line between items shows where a dragged item will be inserted
    box.SetDropHighlightStyle(SFTBOX_DROPHIGHLIGHT_BETWEEN);
    box.SetDarkMode(SFTBOX_DARKMODE_AUTO);

    for (int i = 0 ; i < count ; ++i)
        box.AddString(alpszItems[i]);
    if (count > 0)
        box.SetCurSel(0);
}

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


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