MFC中listbox的困惑,该如何解决


MFC中listbox的困惑
在主对话框中单击一个按钮,弹出子对话框,子对话框中有一个listbox,我不知道如何给这个listbox添加数据,我知道有这个添加函数,可是我不知道代码要发在哪里 见笑了 本人刚接触

  C/C++ code

   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"));



VC编程基础 C++/VC 程序开发

武神红美铃 12 years, 1 month ago


例如在testGDIDlg.cpp中应该添加到

BOOL CtestGDIDlg::OnInitDialog() 中

当然要确保有申明哦

poi123 answered 12 years, 1 month ago


直接显示的话,写在

  C/C++ code

  virtual BOOL OnInitDialog()

法兰西斯-猴 answered 12 years, 1 month ago


可以在初始化对话框的地方增加。
先给对话框添加初始化方法,然后在里面添加。

新岛还我绫学姐 answered 12 years, 1 month ago

Your Answer