VC++读取edit的值及赋值

/*

*读取edit的值及赋值

*/

void CMFCSQLDlg::OnButton4()

{

// TODO: Add your control notification handler code here

SetDlgItemText(IDC_EDIT1,"11");//可以清空

SetDlgItemText(IDC_EDIT2,"22");//可以清空

 

CWnd* pWnd = GetDlgItem(IDC_EDIT1);

CString   str;  

pWnd->GetWindowText(str);

 

CString str1;

GetDlgItemText(IDC_EDIT2,str1);

 

AfxMessageBox(str);

AfxMessageBox(str1);

}

 

转载于:https://www.cnblogs.com/maxblog/archive/2010/05/08/1730338.html

你可能感兴趣的:(c/c++)