GetSelectedItem Method (Feed Control)
Windows - Visual C++
Description
The GetSelectedItem method returns
the index of an item in the current selection. The supplied parameter
indicates which item of the selection should be returned.
Syntax
long value = GetSelectedItem(long nIndex);
The GetSelectedItem syntax has these parts:
Part |
Description |
nIndex |
A long integer indicating which item of the current selection should be returned. |
Remarks
You can obtain the number of items
in the selection using the GetNumberSelected
method. The GetSelectedItem method only applies when the MultipleSelection
property is set to TRUE. Use the CurFocus
property to get the selection of a single selection list box.
An example of using GetSelectedItem:
Suppose you had a feed control containing ten items. Two of them are selected -- the first and fourth items (with indices 1 and 4, respectively). Calling GetSelectedItem with a parameter of 1 would return the value 1 to you since the first item in the selection is at index 1. Calling GetSelectedItem with a parameter of 2 would return the value 4, since the second item in the selection is at index 4.
GetSelectedItem returns -1 if an invalid parameter is supplied or if an error occurs.
See Also: GetNumberSelected SetSelectedItem
Back to: Feed Methods