Freigeben über


CComboBox::DeleteItem

Aufgerufen vom Framework, wenn der Benutzer ein Element aus einem Ownerdrawn-CComboBox-Objekt gelöscht oder das Kombinationsfeld zerstört.

virtual void DeleteItem( 
   LPDELETEITEMSTRUCT lpDeleteItemStruct  
);

Parameter

  • lpDeleteItemStruct
    Ein langer Zeiger auf eine Struktur Windows DELETEITEMSTRUCT, die Informationen über das gelöschte Element enthält. Siehe CWnd::OnDeleteItem für eine Beschreibung dieser Struktur.

Hinweise

Die Standardimplementierung dieser Funktion Auswirkungen. Überschreiben Sie diese Funktion, um das Kombinationsfeld nach Bedarf neu zu zeichnen.

Beispiel

// CMyComboBox is my owner-drawn combo box derived from CComboBox. This  
// example simply dumps the item's text. The combo box control was  
// created with the following code: 
//   pmyComboBox->Create( 
//      WS_CHILD|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL| 
//      CBS_SORT|CBS_OWNERDRAWVARIABLE, 
//      myRect, pParentWnd, 1); 
// 
void CMyComboBox::DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct) 
{
   ASSERT(lpDeleteItemStruct->CtlType == ODT_COMBOBOX);
   LPTSTR lpszText = (LPTSTR) lpDeleteItemStruct->itemData;
   ASSERT(lpszText != NULL);

   AFXDUMP(lpszText);
}

Anforderungen

Header: afxwin.h

Siehe auch

Referenz

CComboBox-Klasse

Hierarchiediagramm

CComboBox::CompareItem

CComboBox::DrawItem

CComboBox::MeasureItem

WM_DELETEITEM