添加combo项的问题
zdtsw 2005-05-05 04:32:11 通过editcontrol 控件输入字符串m_newclass,后点击button1 添加到同一对话框中的combo1中
代码:
CComboBox *pxl = (CComboBox *) GetDlgItem(IDC_COMBO1);
pxl->InsertString(0,m_newclass);
或
m_Combo.AddString(m_newclass);
结果都只出现了空白项,不能显示输入的字符串,但
m_Combo.AddString("上海" );
却能显示,why?
即使添加了”上海” 也只是当前能看到,下次在运行时又回到添加之前,能不能保持?