CComboBox::DeleteItem

调用由结构,当用户从所有者描述 CComboBox 对象删除项目或销毁组合框。

virtual void DeleteItem( 
   LPDELETEITEMSTRUCT lpDeleteItemStruct  
);

参数

备注

此函数的默认实现不执行任何操作。 重写此函数来组合框根据需要。

示例

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

要求

Header: afxwin.h

请参见

参考

CComboBox Class

层次结构图

CComboBox::CompareItem

CComboBox::DrawItem

CComboBox::MeasureItem

WM_DELETEITEM