开发者

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

开发者 https://www.devze.com 2023-02-07 01:07 出处:网络
MSDN article on CListCtrl::GetTopIndex() contains a code sample that goes like this: // Make sure the focus is set to the list view control.

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

精彩评论

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