CMFCDropDownListBox Class

Provides drop-down list box functionality to ribbon combo boxes.

class CMFCDropDownListBox : public CMFCPopupMenu

Members

Public Constructors

Name

Description

CMFCDropDownListBox::CMFCDropDownListBox

Constructs a CMFCDropDownListBox object.

CMFCDropDownListBox::~CMFCDropDownListBox

Destructor.

Public Methods

Name

Description

CMFCDropDownListBox::AddString

Adds a string to the drop-down list box.

CMFCDropDownListBox::DefaultMouseClickOnClose

Specifies whether the framework processes the current mouse click event after a user closes the drop-down list box. (Overrides CMFCPopupMenu::DefaultMouseClickOnClose).

CMFCDropDownListBox::GetCount

Retrieves the number of items in the drop-down list box.

CMFCDropDownListBox::GetCurSel

Retrieves the zero-based index of the currently selected item, if any, in the drop-down list box.

CMFCDropDownListBox::GetText

Retrieves a string from the drop-down list box.

CMFCDropDownListBox::GetThisClass

Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

CMFCDropDownListBox::IsEditFocused

Determines whether the edit control part of the drop-down list box has the input focus.

CMFCDropDownListBox::OnChangeHot

Called by the framework when the currently-selected item on the drop-down list box changes. (Overrides CMFCPopupMenu::OnChangeHot).

CMFCDropDownListBox::OnChooseItem

Called by the framework when the user selects an item from the drop-down list box. (Overrides CMFCPopupMenu::OnChooseItem).

CMFCDropDownListBox::OnDrawItem

Called by the framework when a toolbar menu button in the parent menu is drawn.

CMFCDropDownListBox::OnGetItemSize

Called by the framework when a toolbar menu button in the parent menu calculates its size.

CMFCDropDownListBox::ResetContent

Removes all items from the drop-down list box.

CMFCDropDownListBox::SetCurSel

Selects an item and scrolls it into view.

CMFCDropDownListBox::SetMaxHeight

Sets the maximum height of the drop-down list box.

CMFCDropDownListBox::SetMinWidth

Sets the minimum width of the drop-down list box.

CMFCDropDownListBox::Track

Creates and opens the drop-down list box.

Remarks

This class supports the MFC framework infrastructure and is not intended to be used directly from your code.

The framework uses this class to provide drop-down list behavior to the CMFCRibbonComboBox class. For more information about CMFCRibbonComboBox, see CMFCRibbonComboBox Class.

Example

The following example demonstrates how to use various methods in the CMFCDropDownListBox class. The example shows how to construct a CMFCDropDownListBox object, add a string to the drop-down list box, select an item and scroll it into view, and set the maximum height and minimum width of the drop-down list box.

// CMFCRibbonComboBox *pComboSimple
    CMFCDropDownListBox* listBox = new CMFCDropDownListBox(pComboSimple);
    listBox->AddString(_T("this is a drop down list box"));
    listBox->SetCurSel(0);
    listBox->SetMaxHeight(100);
    listBox->SetMinWidth(10);

Inheritance Hierarchy

CObject

   CCmdTarget

      CWnd

         CFrameWnd

            CMiniFrameWnd

               CMFCPopupMenu

                  CMFCDropDownListBox

Requirements

Header: afxdropdownlistbox.h

See Also

Concepts

MFC Hierarchy Chart

Reference

CMFCRibbonComboBox Class

Other Resources

Classes (MFC Feature Pack)