PressItem Method (ListView)

Class

ListView.

Action

Presses the mouse on an item in the listview.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

listview.PressItem (Item [, iButton, iXpos, iYpos])
Variable Description
Item The item to press. STRING or INTEGER.
iButton Optional: The mouse button to press: Windows: 1 for left (default), 2 for right, and 3 for center INTEGER.
iXpos Optional: The horizontal coordinate. INTEGER.
iYpos Optional: The vertical coordinate. INTEGER.

Notes

  • PressItem is primarily useful for scripting drag and drop operations.
  • PressItem scrolls the specified item into view and then presses the mouse button on the item. The optional arguments allow the button to press and the offset within the item of the location of the press to be specified.
  • The PressItem method is not available in the ListViewEx class, which is the equivalent of the ListView class on the Open Agent. To achieve the same functionality for a listview on the Open Agent, use the Click method of the AnyWin class and the GetItemRect method of the ListViewEx class.

Example

MyDialog.MyListView.PressItem ("listview item to drop")
MyDialog.MyTreeView.ReleaseItem ("/root/child/grandchild")