共用方式為


CMFCRibbonComboBox 類別

CMFCRibbonComboBox 類別實作可以加入至功能區列、功能區面板或功能區快顯功能表的下拉式方塊控制項。

class CMFCRibbonComboBox : public CMFCRibbonEdit

Members

Bb983816.collapse_all(zh-tw,VS.110).gif建構函式

名稱

描述

CMFCRibbonComboBox::CMFCRibbonComboBox

CMFCRibbonComboBox 建構物件。

Bb983816.collapse_all(zh-tw,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

會下拉時,將清單方塊的高度。

備註

功能區上下拉式方塊包含清單方塊結合使用者可以編輯的靜態 (Static) 標籤或標籤。 您必須指定哪一個型別,您需要在建立自己的功能區上下拉式方塊時。

範例

下列範例示範如何建構物件 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 類別