CListBox派生类不显示数据
CMyListBox::CListBox
CMyListBox::OnCreate()
{
this->AddString("aaaaaa");
this->AddString("bbbbbb");
}
CMainDlg::OnInitDialog()
{
......
m_lst.Create(WS_CHILD, rc, this, IDC_LIST); // m_lst在头文件中定义CMyListBox m_lst;
......
this->GetDlgItem(IDC_LIST)->MoveWindow(620, 10, 365, 550);
......
}
CMainDlg::OnPaint()
{
......
m_lst.ShowWindow(SW_SHOW)
......
}
程序运行后,列表框中啥也没有,咋回事啊!