CMFCRibbonComboBox选件类

CMFCRibbonComboBox 选件类实现可以添加到功能区栏、一个或功能区弹出菜单的组合框控件。

class CMFCRibbonComboBox : public CMFCRibbonEdit

成员

Bb983816.collapse_all(zh-cn,VS.110).gif构造函数

名称

说明

CMFCRibbonComboBox::CMFCRibbonComboBox

构造CMFCRibbonComboBox对象。

Bb983816.collapse_all(zh-cn,VS.110).gif公共方法

名称

说明

CMFCRibbonComboBox::AddItem

追加一个项添加到列表框。

CMFCRibbonComboBox::DeleteItem

从列表框删除指定的项目。

CMFCRibbonComboBox::EnableDropDownListResize

指定列表框是否可以更改大小,则下拉。

CMFCRibbonComboBox::FindItem

返回第一项的索引在与指定字符串匹配的列表框中。

CMFCRibbonComboBox::GetCount

返回项的数目在列表框中。

CMFCRibbonComboBox::GetCurSel

获取当前选定项的索引在列表框中。

CMFCRibbonComboBox::GetDropDownHeight

在列表框中删除处于按下状态时,获取列表框的高度。

CMFCRibbonComboBox::GetIntermediateSize

返回组合框的大小显示在中间模式。

CMFCRibbonComboBox::GetItem

返回字符串与项目在列表框中指定的索引。

CMFCRibbonComboBox::GetItemData

返回数据与项目在列表框中指定的索引。

CMFCRibbonComboBox::HasEditBox

指示控件是否包含一个编辑框。

CMFCRibbonComboBox::IsResizeDropDownList

指示列表框是否可调整大小。

CMFCRibbonComboBox::OnSelectItem

调用由结构,当用户在列表框中选择一个项目。

CMFCRibbonComboBox::RemoveAllItems

从列表框删除所有项并清除编辑框。

CMFCRibbonComboBox::SelectItem

在列表框中选择一个项目。

CMFCRibbonComboBox::SetDropDownHeight

它放置处于按下状态时,将列表框的高度。

备注

功能区组合框包含列表框以及可由用户编辑的静态标签或标签。 您必须指定哪个类型需要,当您创建功能区组合框时。

示例

下面的示例演示如何构造对象 CMFCRibbonComboBox 选件类,将项添加到组合框中,组合框中选择一个项目并添加一个组合框添加到面板。

    // Create a simple combo box with two entries:
    // The first parameter is the id of the combo box.
    // The third parameter is the width of the combo box in pixels.
    // The fourth parameter is the display label of the combo box.
    // The fifth parameter is the index of the small image of the combo box.
    CMFCRibbonComboBox *pComboSimple = new CMFCRibbonComboBox(-1, FALSE, -1, 0, -1);

    // Add two items to the combo box and select the first item in the list:
    pComboSimple->AddItem(_T("Hi!"));
    pComboSimple->AddItem(_T("Hello!"));
    pComboSimple->SelectItem(0);

    // Add combo button to "Favorites" panel:
    // CMFCRibbonPanel* pPanelFavorites
    pPanelFavorites->Add(pComboSimple);

继承层次结构

CObject

   CMFCRibbonBaseElement

      CMFCRibbonButton

         CMFCRibbonEdit

            CMFCRibbonComboBox

要求

标头: afxribboncombobox.h

请参见

参考

层次结构图

CMFCRibbonEdit选件类

其他资源

MFC 类