CComboBox::GetTopIndex

int GetTopIndex( ) const;

Return Value

The zero-based index of the first visible item in the list-box portion of the combo box if successful, CB_ERR otherwise.

Remarks

Retrieves the zero-based index of the first visible item in the list-box portion of the combo box. Initially, item 0 is at the top of the list box, but if the list box is scrolled, another item may be at the top.

Example

// The pointer to my combo box.
extern CComboBox* pmyComboBox;

// Want an item in the bottom half to be the first visible item.
int n = pmyComboBox->GetCount()/2;
if (pmyComboBox->GetTopIndex() < n)
{
   pmyComboBox->SetTopIndex(n);
   ASSERT(pmyComboBox->GetTopIndex() == n);
}

CComboBox OverviewClass MembersHierarchy Chart

See Also   CComboBox::SetTopIndex, CB_GETTOPINDEX