MFC中listbox的困惑
在主对话框中单击一个按钮,弹出子对话框,子对话框中有一个listbox,我不知道如何给这个listbox添加数据,我知道有这个添加函数,可是我不知道代码要发在哪里 见笑了 本人刚接触
m_ListBox_Content.AddString(_T("1")); m_ListBox_Content.AddString(_T("2")); m_ListBox_Content.AddString(_T("3")); m_ListBox_Content.AddString(_T("4")); m_ListBox_Content.AddString(_T("5")); m_ListBox_Content.AddString(_T("6")); m_ListBox_Content.AddString(_T("7")); m_ListBox_Content.AddString(_T("8")); m_ListBox_Content.AddString(_T("9"));
virtual BOOL OnInitDialog()
[解决办法]
例如在testGDIDlg.cpp中应该添加到
BOOL CtestGDIDlg::OnInitDialog() 中
当然要确保有申明哦