CListBox::SetAnchorIndex

设置在多个选定内容的定位点列表框启动一个扩展选择。

void SetAnchorIndex( 
   int nIndex  
);

参数

  • nIndex
    指定将是定位点列表框项的从零开始的索引。

备注

在多重选择列表框,定位点项目是在连续选定项块中的第一个或最后一项。

示例

void CMyODListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
   BOOL bOutside = TRUE;
   UINT uItem = ItemFromPoint(point, bOutside);

   if (!bOutside)
   {
      // Set the anchor to be the middle item.
      SetAnchorIndex(uItem);
      ASSERT((UINT)GetAnchorIndex() == uItem);
   }

   CListBox::OnLButtonDown(nFlags, point);
}

要求

Header: afxwin.h

请参见

参考

CListBox Class

层次结构图

CListBox::GetAnchorIndex