我有个自绘的ListBox,我在DrawItem里面
void CMyListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dcItem;
dcItem.Attach(lpDrawItemStruct->hDC); CRect rcItem = lpDrawItemStruct->rcItem;
UINT nIndex = lpDrawItemStruct->itemID; if (nIndex != (UINT)-1) {
TRACE(L"nIndex is : %d\n", nIndex);
dcItem.FillSolidRect(rcItem + CRect(0, 0, 0, -2), RGB(192,192,192));
}
}我在对话框上面
BOOL CTestListBox111Dlg::OnInitDialog()
{
        ....
m_listCorrectAnswer.AddString(L"000");
m_listCorrectAnswer.AddString(L"111");
m_listCorrectAnswer.AddString(L"222");
        ....
return TRUE;  // return TRUE  unless you set the focus to a control
}我又加了个void CTestListBox111Dlg::OnBnClickedButton1()
{
m_listCorrectAnswer.ResetContent();
        Invalidate();
}我想在我单击按钮后,ListBox内容不见了,我们都知道。我还想在ListBox没有Item的时候,自动绘黄色背景,如何做呢???