Export (0) Print
Expand All
Expand Minimize

CListCtrl::EnsureVisible

Ensures that a list view item is at least partially visible.

BOOL EnsureVisible(
   int nItem,
   BOOL bPartialOK 
);

Parameters

nItem
Index of the list view item that is to be visible.
bPartialOK
Specifies whether partial visibility is acceptable.

Return Value

Nonzero if successful; otherwise zero.

Remarks

The list view control is scrolled if necessary. If the bPartialOK parameter is nonzero, no scrolling occurs if the item is partially visible.

Example

// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;

// Ensure that the last item is visible.
int nCount = pmyListCtrl->GetItemCount();
if (nCount > 0)
   pmyListCtrl->EnsureVisible(nCount-1, FALSE);

See Also

CListCtrl Overview | Class Members | Hierarchy Chart | CListCtrl::Scroll

Show:
© 2014 Microsoft