16,472
社区成员
发帖
与我相关
我的任务
分享
void CMyTextDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CFather father;
father.DoModal();
return;
}
//弹出子窗口
void CFather::OnButtonFast()
{
// TODO: Add your control notification handler code here
CFst fst;
if(fst.DoModal()==IDOK)
{
MessageBox("设置成功!");
}
}
//接收传值的函数
void CFather::SetText(CString strText)
{
for(int i=2;i<7;i++)
{
m_listctrl.SetItemText(i,1,strText);
}
}
void CFst::OnOK()
{
// TODO: Add extra validation here
CString strText;
CFather father;
m_edtText.GetWindowText(strText);//获取文本框里的值
father.SetText(strText);//传值给父窗口
CDialog::OnOK();
}
CFather * father=(CFather *)GetParent();
father->SetText(strText);//传值给父窗口