The item currently at the top of the control.

Usage

Set_Property(OLECtrlEntID, "OLE.TopItem", StringValue)

Values

StringValue can be any string meeting the following format requirements:

Syntax: A tree item's unique key

Default: ""

Remarks

The TopItem property gets and sets the item currently at the top of the control. In other words, this property represents the current vertical scroll position. If you simply want to know which item is at the top, then read this property. The value will always be the top item's key.

 


To programmatically scroll the tree control, set this property to the key of the item you wish to place into the top position.


An item can only become the top item if the user would otherwise be able to scroll that item into position. Therefore, the top item may not always be the item you pass into it. For example, if you set TopItem to be the last item in the tree, then the control will set the top item to be the bottom most item necessary to display the end of the tree.

NOTE: This property has an alias: TopPos. In other words, you can use either the TopItem or TopPos properties to get or set the current top item.

Example

// Get the current scroll position 
TopItem = Get_Property(@Window:".OLE_TREE", "OLE.TopItem") 

// Scroll back to the top 
RootItems = Get_Property(@Window:".OLE_TREE", "OLE.RootChildren") 
Set_Property(@Window:".OLE_TREE", "OLE.TopItem", RootItems<1>)

See Also

FocusItemSelectedItemsOnVScroll

  • No labels