method Items.EnsureVisibleItem (Item as HITEM)

Ensures that the given item is in the visible client area.

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

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.

The following VB sample ensures that first item is visible:

ComboBox1.Items.EnsureVisibleItem ComboBox1.Items(0) 

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

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

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

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

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

AxComboBox1.Items.EnsureVisibleItem(AxComboBox1.Items(0))

The following VFP sample ensures that first item is visible:

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

 


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