When an application is running, all list items have at least two properties: Selected and Focus. These properties can be set to True or False. For example if an item does not have the focus nor is selected, both these properties are set to False.
The item properties are manipulated using the list's CurrentItem or FocusItem properties.
The CurrentItem is the item in a list box, list view, combo box or grid which is currently being worked with in the application. The FocusItem is the item in a list, tree view or grid which has the focus on the desktop.
CurrentItem can be set by the user by moving the focus on the item (ItemGotFocus event), in which case it is the same as FocusItem, or it can be set by the program in a GET_ENTRY or SELECTLIST command.
The value of the current item is used as the key in database I/O commands. Therefore data is typically fetched in the ItemGotFocus event which sets the CurrentItem.
You can use the SELECTLIST command to examine the properties of every item in a list. For example the following code goes through the list making one item at a time the CurrentItem and tests whether its Selected property is set to true:
IF '#ltvw_1.CurrentItem.Selected *eq True'
In lists where it is not possible to select more than one entry at a time (tree view, combo box, and list box), the Focus and Selected properties have always the same value. In other words only the item which has focus can be selected. In lists which allow for multiple selection, only one item can have the focus (Focus property set to True), but multiple items can be selected (usually by using the Ctrl and Shift keys).
You can test for the Focus property of items the same way as you test the Selected property:
#ltvw_1.CurrentItem.Focus *eq True