mText(m_id,m_strSex); //m_strSex为添加的类成员,CString型;
//清空列表框
m_list1.ResetContent(); //m_list1为控件变量,control型
//清空
列表框
while(m_list1.GetCount()!=0)
m_list1.DeleteString(0);
//往列表框添加数据
m_list1.AddString(": "+dlg.m_strNo); //加字符串
m_list1.AddString("出生年月: "+dlg.m_tBirth.Format("%Y-%m-%d"));//加日期型
CString str;
str.Format("开课学期:%d", dlg.m_nOpen ); //整型转换为字符串
m_list1.AddString( str );
str.Format("学 分:%4.1f", dlg.m_fCredit); //单精度转换为字符串
m_list1.AddString( str );
//打开添加的对话框,点击"确定"按钮
CInputDlg dlg;
if (dlg.DoModal()==IDOK)
{
//其他语句
}