edit编辑框相关

从Edit Control获取值,然后通过MessageBox输出出来

void CNowaMagic_MFCDlg::OnBnClickedOk()
{
    // TODO: 在此添加控件通知处理程序代码
    //CDialogEx::OnOK();
    //获得EDIT 
    CEdit* pBoxOne; 
    pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1); 
    //赋值 
    //pBoxOne-> SetWindowText( _T("FOO ") ); 
    //取值 
    CString str;
    pBoxOne-> GetWindowText(str); 

    MessageBox(str,_T("程序运行结果"),MB_OK);
    str.ReleaseBuffer();
}

 

posted @ 2014-11-04 15:13  幸福弈然  阅读(104)  评论(0编辑  收藏  举报