Defines the presence of grid lines.
C
BOOL WINAPI SftBox_GetShowGrid(HWND hwndCtl); void WINAPI SftBox_SetShowGrid(HWND hwndCtl, BOOL fSet);
C++
BOOL CSftBox::GetShowGrid() const; void CSftBox::SetShowGrid(BOOL fSet);
hwndCtl
The window handle of the combo box control.
fSet
Set to TRUE to display grid lines, otherwise set to FALSE.
GetShowGrid returns a value indicating whether grid lines are shown in the dropdown portion. TRUE is returned if grid lines are shown, otherwise FALSE is returned.
The GetShowGrid and SetShowGrid functions define the presence of grid lines.
Grid lines are shown in the dropdown portion. In a dropdown list combo box, the static portion also shows grid lines, but only the vertical grid lines. If the grid style defined using SetGridStyle doesn't include vertical grid lines, the static portion has no grid lines. The static portion of a simple or dropdown combo box never has grid lines.
Vertical and horizontal grid lines can be controlled using SetGridStyle.
When using the 3D display mode (enabled using SetShow3D), only vertical grid lines are shown.
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_SetDarkMode(hwndBox, SFTBOX_DARKMODE_AUTO);
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
box.SetDarkMode(SFTBOX_DARKMODE_AUTO);
See Also C/C++ API | Categories | Notifications