How show more items in dialog combobox dropdown list?

  • Thread starter Thread starter Steve Richter
  • Start date Start date
S

Steve Richter

Guest
Using DialogBox to create a modal dialog. The dialog has a single control, a ComboBox. When I click the down arrow in the ComboBox I expect to see a dropdown list with a few items. But that is not the case. The dropdown is only high enough for a single line. I have tried ComboBox_SetItemHeight, but that function did not increase the length of the drop down list. I have tried to switch ComboBox type from Type: Dropdown to DropList.

thanks,

DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG2), 0, DialogProc2);


INT_PTR CALLBACK DialogProc2(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
{
EndDialog(hDlg, TRUE ) ;
return TRUE ;
}

case IDCANCEL:
EndDialog(hDlg, FALSE ) ;
return TRUE;
}
break;

case WM_INITDIALOG:
{
auto hw = GetDlgItem(hDlg, IDC_COMBO1) ;
ComboBox_AddString( hw, L"192.168.70.28") ;
ComboBox_AddString( hw, L"192.168.70.7") ;
// ComboBox_SetItemHeight( hw, 0, 175 ) ;
}


return TRUE ;
}

return FALSE;
}


IDD_DIALOG2 DIALOGEX 0, 0, 309, 177
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,198,156,50,14
PUSHBUTTON "Cancel",IDCANCEL,252,156,50,14
COMBOBOX IDC_COMBO1,21,28,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END

Continue reading...
 
Back
Top