CMFCRibbonComboBox* pGrid = new CMFCRibbonComboBox(ID_PANELVIEW_GRID, TRUE, 37); 
pGrid->AddItem(_T("0" )); 
for (int i = 0; i < 10; i++)

CString str; 
str.Format(_T("%d" ), i + 1); 
pGrid->AddItem(str); 
}
pGrid->SelectItem(0);
pButtonsGroup1->AddButton(pGrid);创建了一个comboBox可是下拉框的宽度是固定的,请问我怎么改变下拉框的宽度
使之随着combobox的宽度改变。

解决方案 »

  1.   

    CMFCRibbonComboBox::EnableDropDownListResize
    Visual Studio 2010 Other Versions This topic has not yet been rated Rate this topic
    Specifies whether the list box can change size when it drops down.void EnableDropDownListResize(
       BOOL bEnable=FALSE 
    );
    Parameters
    [in] bEnable
    TRUE to enable resizing; FALSE to disable resizing.Res
    When resizing is enabled, the list box will change size to fit the items it displays.
      

  2.   

    调用楼上的那个函数,设为TRUE,然后你movewindow下,虽然我不知道这个高级控件的类是咋样的,试试看,在VS2005里没有这个控件类
      

  3.   

    CMFCRibbonComboBox::EnableDropDownListResize