CListCtrl::EnsureVisible This method ensures that a list view item is at least partially visible. The list view control is scrolled if necessary. If the bPartialOK parameter is nonzero, no scrolling occurs if the item is partially visible.BOOL EnsureVisible( int nItem, BOOL bPartialOK );
to solomonlxd(solomonlxd): 这样只能设置滚动条的位置,item并没有滚动to lixiaosan(小三) : 这样好像还是要根据滚动条位置获取当前item,能不能具体点?
This method ensures that a list view item is at least partially visible. The list view control is scrolled if necessary. If the bPartialOK parameter is nonzero, no scrolling occurs if the item is partially visible.BOOL EnsureVisible(
int nItem,
BOOL bPartialOK );
CSize size
);MSDN说有这个
看怎么用吧
SIZE sz;
sz.cx = (nCurrentClickColumn-7)*ColumnWidth;
sz.cy = 0;
CSize szPointB(sz);
ctlList.Scroll(sz);
SIZE sz;
sz.cx = GetScrollPos( SB_HORZ );
sz.cy = GetScrollPos( SB_VERT );
…… CSize szPointB(sz);
ctlList.Scroll(sz);
/////////