HeaderPane
Main
Hide
Share Link
Print

ReorderColumns

Defines whether columns can be reordered using column drag & drop.

C

BOOL WINAPI SftBox_GetReorderColumns(HWND hwndCtl);
void WINAPI SftBox_SetReorderColumns(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftBox::GetReorderColumns() const;
void CSftBox::SetReorderColumns(BOOL fSet);

Parameters

hwndCtl

The window handle of the combo box control.

fSet

Set to TRUE to enable column reordering, otherwise set to FALSE.

Returns

GetReorderColumns returns TRUE if columns can be reordered by the user using the mouse, otherwise FALSE is returned.

Comments

The GetReorderColumns and SetReorderColumns functions define whether columns can be reordered using column drag & drop.

If column reordering is enabled, the user can drag a column header to a new position, in the static portion and in the dropdown portion. The SFTBOXN_REORDERED notification is sent to the parent window when the user has reordered the columns. By default, column reordering is enabled.

Individual columns can be locked in place even if column reordering is in effect, by adding the SFTBOX_COL_KEEPPOS value to the colFlag member of the SFTBOX_COLUMN structure. SFTBOX_COL_KEEPPOS causes the column to remain in the current display position.

If an application wants to retain the column order between sessions, the dispPos member of the SFTBOX_COLUMN structure must be saved for each column. When the application is restarted and the combo box is reinitialized, the values of the dispPos member can be restored for each column before calling SetColumns.

Examples

C View entire sample code

    Parm.lpfnDelete = (SFTBOX_DELETEPROC) FontsDeleteCallback;
    Parm.UserData = 0;
    SftBox_SetDeleteCallback(m_hwndFonts, &Parm);

    // FONT STYLE combo box
    SftBox_SetSelectionStyle(m_hwndStyle, SFTBOX_SELECTION_CELL1);
    SftBox_SetDroppedHeight(m_hwndStyle, 4);
    SftBox_SetResizeHeader(m_hwndStyle, FALSE);
    SftBox_SetReorderColumns(m_hwndStyle, FALSE);
    SftBox_SetShowHeader(m_hwndStyle, SFTBOX_COLSTYLE_BUTTONTEXT);
    SftBox_EnableSortIndicators(m_hwndStyle, TRUE, FALSE);// not sorted, but the column title is as tall as the others
    SftBox_SetDarkMode(m_hwndStyle, SFTBOX_DARKMODE_AUTO);

    InitColumn(&aCols[0], 0, 400, TEXT("Style"));
    SftBox_SetColumns(m_hwndStyle, 1, aCols);

C++ View entire sample code

    Parm.lpfnDelete = FontsDeleteCallback;
    Parm.UserData = (SFTBOX_DWORD_PTR) this;
    m_Fonts.SetDeleteCallback(&Parm);

    // FONT STYLE combo box
    m_Style.SetSelectionStyle(SFTBOX_SELECTION_CELL1);
    m_Style.SetDroppedHeight(4);
    m_Style.SetResizeHeader(FALSE);
    m_Style.SetReorderColumns(FALSE);
    m_Style.SetShowHeader(SFTBOX_COLSTYLE_BUTTONTEXT);
    m_Style.EnableSortIndicators(TRUE, FALSE);// not sorted, but the column title is as tall as the others
    m_Style.SetDarkMode(SFTBOX_DARKMODE_AUTO);

    InitColumn(&aCols[0], 0, 400, _T("Style"));
    m_Style.SetColumns(1, aCols);

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


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