从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();
}

 edit编辑框相关

相关文章:

  • 2022-12-23
  • 2021-04-24
  • 2022-01-24
  • 2021-11-15
  • 2021-07-04
  • 2021-07-19
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2021-07-19
相关资源
相似解决方案