Aracılığıyla paylaş


CListBox::DeleteItem

Kullanıcı bir sahibi tarafından çizilen bir öğeyi sildiğinde çerçevesi tarafından adlı CListBox nesne veya liste kutusu yok eder.

virtual void DeleteItem(
   LPDELETEITEMSTRUCT lpDeleteItemStruct 
);

Parametreler

  • lpDeleteItemStruct
    Windows için uzun bir işaretçi DELETEITEMSTRUCT silinmiş öğe hakkında bilgi içeren yapısı.

Notlar

Bu işlev varsayılan uygulama bir şey yapmaz.Bu işlevi gerektiği gibi bir sahibi tarafından çizilen liste kutusunu yeniden çizmek için geçersiz kılar.

Bkz: CWnd::OnDeleteItem bir açıklaması için DELETEITEMSTRUCT yapısı.

Örnek

// CMyODListBox is my owner-drawn list box derived from CListBox. This 
// example simply frees the item's text. The list box control was created 
// with the following code:
//   m_myODListBox.Create(
//      WS_CHILD|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL|
//      LBS_SORT|LBS_MULTIPLESEL|LBS_OWNERDRAWVARIABLE|LBS_WANTKEYBOARDINPUT,
//      CRect(10,250,200,450), pParentWnd, IDC_MYODLISTBOX);
//
void CMyODListBox::DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct)
{
   ASSERT(lpDeleteItemStruct->CtlType == ODT_LISTBOX);
   LPVOID lpszText = (LPVOID) lpDeleteItemStruct->itemData;
   ASSERT(lpszText != NULL);

   free(lpszText);

   CListBox::DeleteItem(lpDeleteItemStruct);
}

Gereksinimler

Başlık: afxwin.h

Ayrıca bkz.

Başvuru

CListBox sınıfı

Hiyerarşi grafik

CListBox::CompareItem

CWnd::OnDeleteItem

CListBox::DrawItem

CListBox::MeasureItem