共用方式為


CVSListBox Class

The CVSListBox class supports an editable list control.

class CVSListBox : public CVSListBoxBase

Members

Public Constructors

Name

Description

CVSListBox::CVSListBox

Constructs a CVSListBox object.

CVSListBox::~CVSListBox

Destructor.

Public Methods

Name

Description

CVSListBox::AddItem

Adds a string to a list control. (Overrides CVSListBoxBase::AddItem.)

CVSListBox::EditItem

Starts an edit operation on the text of a list control item. (Overrides CVSListBoxBase::EditItem.)

CVSListBox::GetCount

Retrieves the number of strings in an editable list control. (Overrides CVSListBoxBase::GetCount.)

CVSListBox::GetItemData

Retrieves an application-specific 32-bit value that is associated with an editable list control item. (Overrides CVSListBoxBase::GetItemData.)

CVSListBox::GetItemText

Retrieves the text of an editable list control item. (Overrides CVSListBoxBase::GetItemText.)

CVSListBox::GetSelItem

Retrieves the zero-based index of the currently selected item in an editable list control. (Overrides CVSListBoxBase::GetSelItem.)

CVSListBox::PreTranslateMessage

Translates window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. For more information and method syntax, see CWnd::PreTranslateMessage. (Overrides CVSListBoxBase::PreTranslateMessage.)

CVSListBox::RemoveItem

Removes an item from an editable list control. (Overrides CVSListBoxBase::RemoveItem.)

CVSListBox::SelectItem

Selects an editable list control string. (Overrides CVSListBoxBase::SelectItem.)

CVSListBox::SetItemData

Associates an application-specific 32-bit value with an editable list control item. (Overrides CVSListBoxBase::SetItemData.)

Protected Methods

Name

Description

CVSListBox::GetListHwnd

Returns the handle to the current embedded list view control.

Remarks

The CVSListBox class provides a set of edit buttons that enable the user to create, modify, delete, or rearrange the items in a list control.

The following is a picture of the editable list control. The second list entry, which is titled "Item2", is selected for editing.

CVSListBox control

If you use the resource editor to add an editable list control, notice that the Toolbox pane of the editor does not provide a predefined editable list control. Instead, add a static control such as the Group Box control. The framework uses the static control as a placeholder to specify the size and position of the editable list control.

To use an editable list control in a dialog box template, declare a CVSListBox variable in your dialog box class. To support data exchange between the variable and the control, define a DDX_Control macro entry in the DoDataExchange method of the dialog box. By default, the editable list control is created without edit buttons. Use the inherited CVSListBoxBase::SetStandardButtons method to enable the edit buttons.

For more information, see the Samples directory, the New Controls sample, the Page3.cpp and Page3.h files.

Inheritance Hierarchy

CObject

   CCmdTarget

      CWnd

         CStatic

            CVSListBoxBase

               CVSListBox

Requirements

Header: afxvslistbox.h

See Also

Reference

Hierarchy Chart

Other Resources

MFC Classes