Defines the grid line display style.
C
int WINAPI SftBox_GetGridStyle(HWND hwndCtl); void WINAPI SftBox_SetGridStyle(HWND hwndCtl, int style);
C++
int CSftBox::GetGridStyle() const; void CSftBox::SetGridStyle(int style);
hwndCtl
The window handle of the combo box control.
style
A value describing the grid lines displayed.
| SFTBOX_GRID_VERT | Vertical grid lines are drawn around columns using a solid line. |
| SFTBOX_GRID_HORZ | Horizontal grid lines are drawn around items using a solid line. |
| SFTBOX_GRID_BOTH | Vertical and horizontal grid lines are drawn using a solid line. This is the default. |
| SFTBOX_GRID_VERT_DOT | Vertical grid lines are drawn around columns using a dotted line. |
| SFTBOX_GRID_HORZ_DOT | Horizontal grid lines are drawn around items using a dotted line. |
| SFTBOX_GRID_BOTH_DOT | Vertical and horizontal grid lines are drawn using a dotted line. |
GetGridStyle returns the current grid line display style.
The GetGridStyle and SetGridStyle functions define the grid line display style.
The grid line display style applies to the dropdown portion. The static portion of a dropdown list combo box displays vertical grid lines only, using the same line style (solid or dotted). If the style doesn't include vertical grid lines (SFTBOX_GRID_HORZ, SFTBOX_GRID_HORZ_DOT), the static portion doesn't display grid lines.
The color used for grid lines can be defined using SFTBOX_COLORS, colorGridVert and colorGridHorz.
If grid lines are not shown (see SetShowGrid), this function has no visible effect.
Horizontal grid lines are not drawn if items are drawn using a 3D display method (see SetShow3D).
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_SetDarkMode(hwndBox, SFTBOX_DARKMODE_AUTO);
// The edit portion shows and searches this column.
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
box.SetDarkMode(SFTBOX_DARKMODE_AUTO);
// The edit portion shows and searches this column.See Also C/C++ API | Categories | Notifications