SetFirstVisible

Description

Sets the specified item as the first visible item in a TreeView control.

Applies to

TreeView controls

Syntax

treeviewname.SetFirstVisible ( itemhandle )

Argument

Description

treeviewname

The TreeView control in which you want to identify an item as the first visible item

itemhandle

The handle of the item you are identifying as the first visible item in the TreeView control


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs.

Usage

Use to give focus to the TreeView item specified by the itemhandle and scroll it to the top of the TreeView control (or as close to the top as the item list allows; if the item is the last item in a TreeView control, for example, it cannot scroll to the top of the control).

Examples

This example sets the current TreeView item as the first item visible in a TreeView control:

long ll_tvi
int li_tvret
 
ll_tvi = tv_list.FindItem(CurrentTreeItem! , 0)
 
li_tvret = tv_list.SetFirstVisible(ll_tvi)
IF li_tvret = -1 THEN
      MessageBox("Warning!" , "Didn't Work")
END IF

See also

FindItem

SetItem