Ensures the given item is in the visible client area.
Type | Description | |||
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:
Gantt1.Items.EnsureVisibleItem Gantt1.Items(0)
The following C++ sample ensures that first item is visible:
#include "Items.h" CItems items = m_gantt.GetItems(); items.EnsureVisibleItem( items.GetItemByIndex( 0 ) );
The following C# sample ensures that first item is visible:
axGantt1.Items.EnsureVisibleItem(axGantt1.Items[0]);
The following VB.NET sample ensures that first item is visible:
AxGantt1.Items.EnsureVisibleItem( AxGantt1.Items.FocusItem );
The following VFP sample ensures that first item is visible:
with thisform.Gantt1.Items .EnsureVisibleItem( .ItemByIndex( 0 ) ) endwith