Partager via


List View Control

A list view control displays a collection of items, each consisting of an icon and a label, and provides several ways to display and arrange the items. For example, additional information about each item is displayed in columns to the right of the icon and label. Windows Explorer uses a list view control to display files.

The window class name for a list view control is WC_LISTVIEW, which is defined as "SysListView" in Commctrl.h.

Supported Properties and Methods

  • accDoDefaultAction
    The list view object itself does not have a DefaultAction property; however, the accDoDefaultAction method double clicks list view items.

  • accHitTest
    accLocation
    accNavigate
    accSelect
    get_accChild
    get_accChildCount
    Returns the number of items in the list.

  • get_accDefaultAction
    The list view object itself does not have a DefaultAction property; however, the DefaultAction property for each list view item is "Double Click".

  • get_accDescription
    The list view object itself does not support the Description property; however, the Description property for each list view item is the text contained in the item's second and subsequent columns. A comma is inserted between the text for each column.

  • get_accFocus
    get_accHelp
    get_accHelpTopic
    get_accKeyboardShortcut
    List views objects do not have keyboard shortcuts. However, if the window text for the list view contains an ampersand (&) character, Active Accessibility returns a non-Null string as the KeyboardShortcut property.

  • get_accName
    The Name for the list view object is obtained from the control's window text (or caption). This text is not displayed with the list view control, so server developers must provide meaningful text in the control's resource definition statement to help users of client utilities to identify the control. For the list view items, the Name property is the text of the list item.

  • get_accParent
    The Parent property of the list view object is a window (ROLE_SYSTEM_WINDOW) that surrounds the control and has the same Name property and window class name as the control. The Parent property of the list view items is the list view object.

  • get_accRole
    The list view window has the Role property of ROLE_SYSTEM_LIST, and each item in the list view has the Role property of ROLE_SYSTEM_LISTITEM.

  • get_accSelection
    get_accState
    The State property of the list view object is a combination of one or more of the following values:

    STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_UNAVAILABLE | STATE_SYSTEM_FOCUSED | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_OFFSCREEN

    The State property of the list view items is a combination of one or more of the following values:

    STATE_SYSTEM_INVISIBLE | STATE_SYSTEM_FOCUSED | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_SELECTABLE | STATE_SYSTEM_SELECTED | STATE_SYSTEM_MULTISELECTABLE | STATE_SYSTEM_HOTTRACKED | STATE_SYSTEM_OFFSCREEN | STATE_SYSTEM_NORMAL

    Additionally, check box list view items also have the state STATE_SYSTEM_CHECKED.

Events Generated

EVENT_OBJECT_CREATE

EVENT_OBJECT_DESTROY

EVENT_OBJECT_REORDER

EVENT_OBJECT_FOCUS

EVENT_OBJECT_SELECTION

EVENT_OBJECT_SELECTIONADD

EVENT_OBJECT_SELECTIONREMOVE

EVENT_OBJECT_NAMECHANGE

Remarks

Active Accessibility does not expose list view item text in applications that use a callback function to add the text to the item.

List view items that are clipped do not have STATE_SYSTEM_INVISIBLE set. To determine if a list item is clipped, clients can compare the item's coordinates returned by accLocation with the clipping region of the window.

Active Accessibility does not support using the accNavigate method to navigate to the header control within a list view control that is in Details view. However, clients use the AccessibleObjectFromPoint function to get to the header control.

For non-rectangular objects such as list view items in the Details view, the coordinates of the item's bounding rectangle retrieved by accLocation fail if tested with accHitTest because accHitTest determines the object's boundaries on a pixel-by-pixel basis.

See Also

IAccessible Interface