谢谢!

解决方案 »

  1.   

    先把属性改为list,改变下拉高度后,再把属性改回来就可以了。
      

  2.   

    呵呵,告诉你,下拉高度就是Combobox的高度,
    GetDlgItem(IDC_COMBO1)->MoveWindow(0,0,100,500);
    就行了
      

  3.   

    extern CComboBox* pmyComboBox;// Find the longest string in the combo box.
    CString str;
    CSize   sz;
    int     dx=0;
    CDC*    pDC = pmyComboBox->GetDC();
    for (int i=0;i < pmyComboBox->GetCount();i++)
    {
       pmyComboBox->GetLBText( i, str );
       sz = pDC->GetTextExtent(str);   if (sz.cx > dx)
          dx = sz.cx;
    }
    pmyComboBox->ReleaseDC(pDC);// Adjust the width for the vertical scroll bar and the left and right border.
    dx += ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);// Set the width of the list box so that every item is completely visible.
    pmyComboBox->SetDroppedWidth(dx);