A specific item will be displayed at the very top in a list window.


setValue(string shape, "topPos", int item);

shape.topPos(int item);


Parameter Description
shape Name of the object
item Index of the first item to be shown, starting with 1


If list items can no longer fit into the list window, "topPos" is used to specify the index of the list item to be shown at the top. The displayed items will be shifted accordingly. The list items will not be rearranged. The parameter "item" defines the index of the first item in the window. The condition "item"==0 represents a special case where the list is scrolled down to the "last" element.


In the following example, the 3rd item will be displayed at the top for the object "selectionlist1".

  shape list=getShape("selectionlist1");
  list.topPos(3); // First item


Selection list