List Box

List boxes display a list from which a user can select one or more items. A list box is created with a vertical scroll bar, a horizontal control bar, or both.

The window class name for a list box is "LISTBOX".

Supported Properties and Methods

  • accDoDefaultAction
    The list box object itself does not have a DefaultAction property; however, DoDefaultAction double clicks list box items.

  • accHitTest
    The HitTest method returns zero if the tested point is within the list box but not on an item in the list box. If the tested point is on an item in the list box, HitTest returns the index of the list box item.

  • accLocation
    accNavigate
    accSelect
    get_accChild
    get_accChildCount
    The ChildCount is the number of items in the list box.

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

  • get_accDescription
    get_accFocus
    get_accHelp
    get_accHelpTopic
    get_accKeyboardShortcut
    The KeyboardShortcut property is the list box's access key, which is an underlined character in the text of the label associated with the list box. The returned string contains the access key character appended to the string "Alt+".

  • get_accName
    The Name property for the list box object is the text from a static text control that labels the list box. For the list box items, the Name property is the text of the list item.

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

  • get_accRole
    The Role property is ROLE_SYSTEM_LIST. The items in the list box have the Role property of ROLE_SYSTEM_LISTITEM.

  • get_accSelection
    The Selection property retrieves the selected items in the list box.

  • get_accState
    The State property of the list box 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 box item is a combination of one or more of the following values:

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

Events Generated

EVENT_OBJECT_SELECTIONADD

EVENT_OBJECT_SELECTIONREMOVE

EVENT_OBJECT_SELECTIONWITHIN

See Also

IAccessible Interface, Combo Box, Scroll Bar