HeaderPane
Main
Hide
Share Link
Print

HeaderStyle

Defines the column header display style.

C

int WINAPI SftBox_GetHeaderStyle(HWND hwndCtl);
void WINAPI SftBox_SetHeaderStyle(HWND hwndCtl, int style);

C++

int CSftBox::GetHeaderStyle() const;
void CSftBox::SetHeaderStyle(int style);

Parameters

hwndCtl

The window handle of the combo box control.

style

Defines the display style used for column headers. Style can be one of the following values:

SFTBOX_COLSTYLE_BUTTONTEXTColumn headers are displayed as buttons.
SFTBOX_COLSTYLE_TITLETEXTColumn headers are displayed as titles.

Returns

GetHeaderStyle returns a value indicating the current column header display style.

Comments

The GetHeaderStyle and SetHeaderStyle functions define the column header display style.

SetHeaderStyle changes the display style of the column headers, without changing whether column headers are shown. The presence of column headers in the static portion and in the dropdown portion is defined using SetShowHeaderMain and SetShowHeaderDropDown. The new style is used for the column headers of both portions.

If style is not one of the values listed, SetHeaderStyle is ignored. The value SFTBOX_COLSTYLE_NONE cannot be used with SetHeaderStyle. Use SetShowHeader, SetShowHeaderMain or SetShowHeaderDropDown to hide column headers.

GetHeaderStyle returns the style last set using SetHeaderStyle or SetShowHeader. Until a style has been set, GetHeaderStyle returns SFTBOX_COLSTYLE_NONE and column headers made visible using SetShowHeaderMain or SetShowHeaderDropDown are displayed as titles.

If the dropdown portion is shown, SetHeaderStyle hides it.

Examples

C View entire sample code

    int i;

    InitColumn(&aCols[COL_NAME], COL_NAME, 100, TEXT("State"));
    InitColumn(&aCols[COL_ABBR], COL_ABBR, 40, TEXT("Abbr."));
    InitColumn(&aCols[COL_CAPITAL], COL_CAPITAL, 100, TEXT("Capital"));
    SftBox_SetColumns(hwndBox, COL_COUNT, aCols);

    SftBox_SetShowHeaderDropDown(hwndBox, TRUE);// Column titles in the dropdown, as buttons
    SftBox_SetHeaderStyle(hwndBox, SFTBOX_COLSTYLE_BUTTONTEXT);
    SftBox_EnableSortIndicators(hwndBox, TRUE, TRUE);// A clicked column title shows the sort direction
    SftBox_SetShowGrid(hwndBox, TRUE);
    SftBox_SetGridStyle(hwndBox, SFTBOX_GRID_VERT);
    SftBox_SetDroppedHeight(hwndBox, 10);       // Show up to 10 items
    SftBox_SetDropDownOptimalWidth(hwndBox, TRUE);// The dropdown is as wide as its columns
    SftBox_SetDisableNoScroll(hwndBox, TRUE);   // Scroll bars always shown, needed for the sizing box
    SftBox_SetShowResizer(hwndBox, TRUE);       // The user can resize the dropdown

C++ View entire sample code

    SFTBOX_COLUMN aCols[COL_COUNT];

    InitColumn(&aCols[COL_NAME], COL_NAME, 100, _T("State"));
    InitColumn(&aCols[COL_ABBR], COL_ABBR, 40, _T("Abbr."));
    InitColumn(&aCols[COL_CAPITAL], COL_CAPITAL, 100, _T("Capital"));
    box.SetColumns(COL_COUNT, aCols);

    box.SetShowHeaderDropDown(TRUE);    // Column titles in the dropdown, as buttons
    box.SetHeaderStyle(SFTBOX_COLSTYLE_BUTTONTEXT);
    box.EnableSortIndicators(TRUE, TRUE);// A clicked column title shows the sort direction
    box.SetShowGrid(TRUE);
    box.SetGridStyle(SFTBOX_GRID_VERT);
    box.SetDroppedHeight(10);           // Show up to 10 items
    box.SetDropDownOptimalWidth(TRUE);  // The dropdown is as wide as its columns
    box.SetDisableNoScroll(TRUE);       // Scroll bars always shown, needed for the sizing box
    box.SetShowResizer(TRUE);           // The user can resize the dropdown

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


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