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.
- C#
- VB.NET
public interface ISalListControl
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
Count
Int32: Gets the number of items in the list.
Item(index)
Object: Gets or replaces the item at the specified position.
Items
IList: Gets the underlying collection of list items.
SelectedIndex
Int32: Gets or sets the zero-based selected item index; -1 represents no selection.
SelectedIndices
Int32[]: Gets the zero-based indices of the selected items.
SelectedItem
Object: Gets or sets the selected item object.
SelectionMode
SelectionMode: Gets or sets the selection mode supported by the concrete list control.
Methods
Add(item)
Adds an item and returns its position in the list.
| Parameter | Type | Description |
|---|---|---|
| item | Object | The object to add. |
Returns: Int32. The zero-based index of the added item.
AddRange(items)
Adds the supplied objects to the list.
| Parameter | Type | Description |
|---|---|---|
| items | Object[] | The objects to add. |
Clear()
Removes all items from the list.
Delete(index)
Removes the item at the specified position.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The 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.
Find(item)
Finds the first item equal to the supplied object.
| Parameter | Type | Description |
|---|---|---|
| item | Object | The object to locate. |
Returns: Int32. The zero-based item index, or -1 if no matching item exists.
FindString(text, startIndex)
Searches for an item whose display text begins with the specified text.
| Parameter | Type | Description |
|---|---|---|
| text | String | The text prefix to locate. |
| startIndex | Int32 | The 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.
FindStringExact(text, startIndex)
Searches for an item whose complete display text matches the specified text.
| Parameter | Type | Description |
|---|---|---|
| text | String | The complete item text to locate. |
| startIndex | Int32 | The 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.
Insert(index, item)
Inserts an item at the requested position, or adds it when the index is -1.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based insertion position, or -1 to add the item. |
| item | Object | The 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.
IsSelected(index)
Determines whether an item is selected.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based item index. |
Returns: Boolean. if the item is selected; otherwise, .
SetSelected(index, selected)
Changes the selection state of the specified item.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based item index. |
| selected | Boolean | to select the item; to deselect it. |
UpdateItem(index)
Refreshes the display of the specified item after its content changes.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The zero-based index of the item to refresh. |
Implemented By
| Name | Description |
|---|---|
| SalComboBox | Combines an editable value and selectable list with SAL validation, formatting, and window actions. |
| SalListBox | Provides a Windows Forms item list with SAL selection operations, modification tracking, and window actions. |
| SalTableColumn | Defines a SAL table column and the editing, formatting, and list behavior of its current cell. |
| SalQuickToolTipComboBox | Provides a SAL combo box with Quick Objects tooltip and status-text compatibility methods. |
| SalQuickToolTipListBox | Provides 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 |