开发者

Why does MSDN sample insist on having focus on a list control before calling CListCtrl::GetTopIndex()?

MSDN article on CListCtrl::GetTopIndex() contains a code sample that goes like this:

// Make sure the focus is set to the list view control.
listControl->SetFocus();

// Select all of the items that are completely visible.
int topIndex = listControl->GetTopIndex();
int lastIndex = listControl+ listControl->GetCountPerPage();

//then there开发者_运维问答's a for-loop for the items in range from topIndex to lastIndex

Why is the comment insisting on the call to SetFocus()?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜