1. CComboBox dropdown is only showing one item in dropdown list
I have a simple little CDialogImpl-derived class that has a dropdown-style ComboBox on it. When I call AddString repeatedly, the actual dropdown size doesn't show all the items. In fact, it only shows one and I have to use the scrollbar buttons to see the other items - it's almost like I have a spinner instead of a dropdown list. The implementation is pretty straighforward - I derive from CDialogImpl in code and have a dropdown ComboBox in the resource file. I use a CComboBox wrapper and do an Attach in the CDialogImpl-derived OnInitDialog method. I can call AddString fine, but the dropdown size seems to be stuck at a single item height. Does anyone have any suggestions? Thanks in advance for any help. -- Bob Sr. Microsoft Architect Lighthammer Software
2. CComboBox, dropdown list height
3. CComboBox - change dropdown/list styke at runtime
I've a dialog resource containing several combo-boxes, created with the
CBS_DROPDOWNLIST style:
COMBOBOX IDC_CMB_INPUT1,14,111,100,68,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP,0,HIDC_CMB_INPUT1
At runtime, I'd like to change some of these to CBS_DROPDOWN (to allow the
user to add their own text) depending on the state of other things in the
project.
In the property page's OnInitDialog(), I call:
CPropertyPage::OnInitDialog();
CComboBox* pCmb = static_cast<CComboBox*>(GetDlgItem(IDC_CMB_INPUT1));
pCmb->ModifyStyle(CBS_DROPDOWNLIST, CBS_DROPDOWN, TRUE);
I've verified that the style changes, and that ModifyStyle() returns TRUE,
but the control remains a drop list. I'm guessing that OnInitDialog() is too
late, as this part of the style cannot be redone (subclassing with Edit
control??).
Thank you,
4. Change the size of the dropdown list in CComboBox
5. CComboBox problem (list box isn't shown)
Hello,
I use ComboBox in my dialog application. It is declared as follows:
COMBOBOX IDC_COMBO1,267,7,96,15,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP | WS_CHILD
Then I use InsertString to add strings:
int ind = 0;
CString tmp;
while(!pComboRs->EndOfFile)
{
ComboStr *pCS = new ComboStr;
pCS->kgor = (long)pComboRs->Fields->Item["kgor"]->Value;
pCS->date = pComboRs->Fields->Item["datauz"]->Value;
tmp.Format("%d", pCS->kgor);
pTab6->m_combo.InsertString(ind, tmp);
pTab6->m_combo.SetItemData(ind, (DWORD)pCS);
ind++;
pComboRs->MoveNext();
}
When the dialog window is shown, I try to select items by clicking the
"arrow down" button of the combo box. But list box doesn't appear though I
can scroll through item list using keyboard with strings being shown in edit
box. So why is the list box empty?
Regards,
Vladimir.