Share via


Methods

The ListBox HTC supports the following methods:

  • add
  • addItem
  • movedown
  • moveup
  • remove
  • select
  • SelectAll
  • unselect
  • UnselectAll

add(xmlNodes)

The add method adds one or more items to the list, based on the data contained in the xmlNodes object passed via the required xmlNodes parameter. This xmlNodes object must have the same format as that returned by the remove method. Beyond that, no other format assumptions should be made.

This method does not return any value.

This method is most useful when moving one or more items from one ListBox HTC to another ListBox HTC.

Return to top

addItem(sValue, sText)

The addItem method adds a single item to the list based on the values of the required parameters sValue and sText. The sValue parameter specifies the value associated with the new item, and the sText parameter specifies the display name of the new item.

This method does not return any value.

Return to top

movedown

The movedown method moves the selected item to the next lower position in the list.

When in multi-select mode, this property moves a single selected item down one position, even if multiple items are selected. It moves either the first or the last selected item in the list. Therefore, you should not rely on this method when in multi-select mode.

This method does not return any value.

Return to top

moveup

The moveup method moves the selected item to the next higher position in the list.

When in multi-select mode, this property moves a single selected item up one position, even if multiple items are selected. It moves either the first or the last selected item in the list. Therefore, you should not rely on this method when in multi-select mode.

This method does not return any value.

Return to top

remove

The remove method removes all selected items from the list and returns those items in XML representation. The returned xmlNodes object has the same format as that required by the add method. Beyond that, no other format assumptions should be made.

This method is most useful when moving one or more items from one ListBox HTC to another ListBox HTC.

Example: set xmlNodes = elListBox.remove

Return to top

select(sValue)

The select method selects the first item found that has a value equal to the required sValue parameter. If nothing is found, nothing is selected (this is not considered an error, so no error is returned).

This method does not return any value.

Return to top

SelectAll

The SelectAll method selects all of the items in the list. It does not take any parameters or return any value.

Return to top

unselect(sValue)

The unselect method unselects the first item found that has a value equal to the required sValue parameter. If nothing is found, nothing is unselected (this is not considered an error, so no error is returned).

This method does not return any value.

Return to top

UnselectAll

The UnselectAll method unselects all of the items in the list. It does not take any parameters or return any value.

Return to top

Copyright © 2005 Microsoft Corporation.
All rights reserved.