怎样得到编辑框的内容?

GetDlgTtemText(IDC_EDI1,str);
或者:
GetDlgItem(IDC_EDIT1)->GetWindowsText(str);
或者:
你定议一个控件变量:CEdit m_edit;
然后
updateDate(true);\\得到数据

例如:
CString str;
GetDlgItemText(IDC_EDIT1,str);
-----------------------------------------------------------
仅仅已某软件获取作者名称为例

1. 对于每一个文本框控件我们肯定需要以下两个变量
请将其声明在对话框类中

------------------
&brvbarText ¦ --> CString EditAuthor
------------------
¦
¦
->CEdit Author

2. 这两个变量有以下联合操作

Author.GetWindowText(EditAuthor); //获得文本框目前的内容并放在EditAuthor中

Author.SetWindowText(EditAuthor); //设置文本框目前的内容为EditAuthor

3. 关于UpdateData的解释
Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.

Published At
Categories with Web编程
Tagged with
comments powered by Disqus