CMFCDropDownListBox Class
Provides drop-down list box functionality to ribbon combo boxes.
class CMFCDropDownListBox : public CMFCPopupMenu
Members
Public Constructors
Name |
Description |
Constructs a CMFCDropDownListBox object. |
|
CMFCDropDownListBox::~CMFCDropDownListBox |
Destructor. |
Public Methods
Name |
Description |
Adds a string to the drop-down list box. |
|
Specifies whether the framework processes the current mouse click event after a user closes the drop-down list box. (Overrides CMFCPopupMenu::DefaultMouseClickOnClose). |
|
Retrieves the number of items in the drop-down list box. |
|
Retrieves the zero-based index of the currently selected item, if any, in the drop-down list box. |
|
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. |
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. |
Removes all items from the drop-down list box. |
|
Selects an item and scrolls it into view. |
|
Sets the maximum height of the drop-down list box. |
|
Sets the minimum width of the drop-down list box. |
|
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
Requirements
Header: afxdropdownlistbox.h