Skip to main content

ISalListControl

Namespace: PPJ.Runtime

Assembly: PPJ.Runtime.50 (5.0.0.0)

Provides SAL list operations over list-box and combo-box items and selections.

public interface ISalListControl

Indices are zero-based. Selection modes supported by a concrete control can differ; a combo box supports a single selected item.

Example:

void Populate(PPJ.Runtime.ISalListControl list)
{
list.Clear();
list.AddRange(new object[] { "London", "Paris", "Rome" });
list.SelectedIndex = list.Find("Paris");
}

Properties​

Instance member Count​

Int32: Gets the number of items in the list.

Instance member Item(index)​

Object: Gets or replaces the item at the specified position.

Instance member Items​

IList: Gets the underlying collection of list items.

Instance member SelectedIndex​

Int32: Gets or sets the zero-based selected item index; -1 represents no selection.

Instance member SelectedIndices​

Int32[]: Gets the zero-based indices of the selected items.

Instance member SelectedItem​

Object: Gets or sets the selected item object.

Instance member SelectionMode​

SelectionMode: Gets or sets the selection mode supported by the concrete list control.

Methods​

Instance member Add(item)​

Adds an item and returns its position in the list.

ParameterTypeDescription
itemObjectThe object to add.

Returns: Int32. The zero-based index of the added item.

Instance member AddRange(items)​

Adds the supplied objects to the list.

ParameterTypeDescription
itemsObject[]The objects to add.

Instance member Clear()​

Removes all items from the list.

Instance member Delete(index)​

Removes the item at the specified position.

ParameterTypeDescription
indexInt32The zero-based index of the item to remove.

Returns: Int32. The remaining item count, or Sys.LB_Err if the index is outside the list.

Instance member Find(item)​

Finds the first item equal to the supplied object.

ParameterTypeDescription
itemObjectThe object to locate.

Returns: Int32. The zero-based item index, or -1 if no matching item exists.

Instance member FindString(text, startIndex)​

Searches for an item whose display text begins with the specified text.

ParameterTypeDescription
textStringThe text prefix to locate.
startIndexInt32The index preceding the first item to search, or -1 to begin with the first item.

Returns: Int32. The matching index, or -1 if no match exists, the list is empty, or the starting index is outside the supported range.

The SAL list-box and combo-box implementations reject a starting index at or beyond the last item.

Instance member FindStringExact(text, startIndex)​

Searches for an item whose complete display text matches the specified text.

ParameterTypeDescription
textStringThe complete item text to locate.
startIndexInt32The index preceding the first item to search, or -1 to begin with the first item.

Returns: Int32. The matching index, or -1 if no match exists, the list is empty, or the starting index is outside the supported range.

The SAL list-box and combo-box implementations reject a starting index at or beyond the last item.

Instance member Insert(index, item)​

Inserts an item at the requested position, or adds it when the index is -1.

ParameterTypeDescription
indexInt32The zero-based insertion position, or -1 to add the item.
itemObjectThe object to insert.

Returns: Int32. The insertion index, or Sys.LB_Err for an invalid position. A sorted list box reports the item's sorted position.

Instance member IsSelected(index)​

Determines whether an item is selected.

ParameterTypeDescription
indexInt32The zero-based item index.

Returns: Boolean. if the item is selected; otherwise, .

Instance member SetSelected(index, selected)​

Changes the selection state of the specified item.

ParameterTypeDescription
indexInt32The zero-based item index.
selectedBooleanto select the item; to deselect it.

Instance member UpdateItem(index)​

Refreshes the display of the specified item after its content changes.

ParameterTypeDescription
indexInt32The zero-based index of the item to refresh.

Implemented By​

NameDescription
SalComboBoxCombines an editable value and selectable list with SAL validation, formatting, and window actions.
SalListBoxProvides a Windows Forms item list with SAL selection operations, modification tracking, and window actions.
SalTableColumnDefines a SAL table column and the editing, formatting, and list behavior of its current cell.
SalQuickToolTipComboBoxProvides a SAL combo box with Quick Objects tooltip and status-text compatibility methods.
SalQuickToolTipListBoxProvides a SAL list box with Quick Objects tooltip and status-text compatibility methods.
VisColorComboBox
VisColorListBox
VisColorPaletteDropDown
VisComboBoxBase
VisDesktopListBox
VisDirListBox
VisDirTreeListBox
VisDriveListBox
VisDropDownBase
VisFileListBox
VisFontComboBox
VisFontListBox
VisFontNameComboBox
VisFontNameListBox
VisListBoxBase
VisListViewDropDown
VisOutlineComboBox
VisOutlineListBox
VisPictureComboBox
VisPictureListBox
VisRadioListBox