Defines the presence and display style of column headers.
C
int WINAPI SftBox_GetShowHeader(HWND hwndCtl); void WINAPI SftBox_SetShowHeader(HWND hwndCtl, int style);
C++
int CSftBox::GetShowHeader() const; void CSftBox::SetShowHeader(int style);
hwndCtl
The window handle of the combo box control.
style
A value describing the column header display style:
| SFTBOX_COLSTYLE_NONE | No column headers. |
| SFTBOX_COLSTYLE_BUTTONTEXT | Displays column headers as buttons. |
| SFTBOX_COLSTYLE_TITLETEXT | Displays column headers as titles. |
GetShowHeader returns a value describing the current column header display style.
The GetShowHeader and SetShowHeader functions define the presence and display style of column headers.
If SFTBOX_COLSTYLE_BUTTONTEXT or SFTBOX_COLSTYLE_TITLETEXT is specified, the static portion shows column headers using that display style. Whether the dropdown portion shows column headers is not changed (see SetShowHeaderDropDown); if it does, they are shown using the new display style. SFTBOX_COLSTYLE_NONE hides the column headers of both portions.
If style is not one of the values listed above, SetShowHeader has no effect.
If the dropdown portion of a dropdown or dropdown list combo box is currently displayed, SetShowHeader hides it.
Column header attributes can be manipulated using SetColumns.
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
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 dropdownSee Also C/C++ API | Categories | Notifications