ControlsListBox (Object)

Member of:

Controls collection, DashboardSection object

Description:

Represents a Dashboard list box that enables you to select items.

Example:

This example shows how to clear the values in a list box and use values from a results column. This example uses JavaScript sorting functions that sort data before populating the control:

Note:

JavaScript arrays are 0 based; all collections are 1 based.

ListBox.RemoveAll()
MyArray = new Array()
RowCount = ActiveDocument.Sections["Results"].RowCount
//GetCell Returns the value of an individual cell in a Column
for (j = 1; j <= RowCount; j++)
   MyArray[j] = ActiveDocument.Sections["Results"].Columns[1].GetCell(j)
//Use JavaScripts built in Array sorting to sort the values
SortedArray = MyArray.sort()
// Add all the sorted items to the listbox control
for (j = 0; j< MyArray.length;j++)
ListBox.Add(SortedArray[j])

Methods:

Add(Value As String), Item(Index As Number) As String, OnClick(), OnClientClick (), OnDoubleClick(), Remove(Index As Number), RemoveAll(), Select(Index As Number), Unselect(Index As Number)

Properties:

Read-only: Property Count As Number, Property Name As String, Property Type As BqShapeType

Read-write: AccessibilityText (Property), Alignment (Property) As BqHorizontalAlignment,, AppendObjectText (Property), Property ClientScriptStatus as Boolean, Property Enabled As Boolean, Property MultiSelect As Boolean, Property Text As String, Property VerticalAlignment As BqVerticalAlignment, Property Visible As Boolean

Objects and Collections:

UserValues (Collection), Font As Font, SelectedList As SelectedList