method Items.EnsureVisibleItem (Item as HITEM)

Ensures the given item is in the visible client area.

 TypeDescription 
   Item as HITEM A long expression that indicates the item's handle that fits the client area.  

The method doesn't expand parent items. The EnsureVisibleItem method scrolls the control's content until the item is visible. Use the IsItemVisible to check if an item fits the control's client area. Use the Scroll method to scroll programmatically the control. Use the EnsureVisibleColumn method to ensure that a specified column fits the control's client area.

The following VB sample ensures that first item is visible:

Tree1.Items.EnsureVisibleItem Tree1.Items(0) 

The following C++ sample ensures that first item is visible:

#include "Items.h"
CItems items = m_tree.GetItems();
items.EnsureVisibleItem( items.GetItemByIndex( 0 ) );

The following C# sample ensures that first item is visible:

axTree1.Items.EnsureVisibleItem(axTree1.Items[0]);

The following VB.NET sample ensures that first item is visible:

AxTree1.Items.EnsureVisibleItem( AxTree1.Items.FocusItem );

The following VFP sample ensures that first item is visible:

with thisform.Tree1.Items
	.EnsureVisibleItem( .ItemByIndex( 0 ) )
endwith

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.