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 EnsureVisibleItem method ensures that the item fits the control's visible area. The EnsureVisibleItem method scrolls the control's content until the item fits the control's visible area. The EnsureVisibleItem method expands the parent items in case it is collapased. 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 EnsureVisibleBar method ensures that the given item-bar fits the chart's visible area.

The following VB sample ensures that first item is visible:

G2antt1.Items.EnsureVisibleItem G2antt1.Items(0) 

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

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

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

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

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

AxG2antt1.Items.EnsureVisibleItem( AxG2antt1.Items.FocusItem );

The following VFP sample ensures that first item is visible:

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