CListBox::SetAnchorIndex

更新 : 2007 年 11 月

複数選択リスト ボックスに、拡張選択を開始するためのアンカー項目を設定します。

void SetAnchorIndex(
   int nIndex 
);

パラメータ

  • nIndex
    アンカー項目とするリスト ボックス項目を 0 から始まるインデックスで指定します。

解説

複数選択リスト ボックスのアンカー項目は、連続した選択項目の最初の項目または最後の項目です。

使用例

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);
}

必要条件

ヘッダー : afxwin.h

参照

参照

CListBox クラス

階層図

CListBox::GetAnchorIndex

その他の技術情報

CListBox のメンバ