关于edit box的问题

chengliang80 2002-05-14 04:17:49
我的程序中有一个edit box,他的旁边有一个按钮,edit box叫
IDC_EDIT1,我定义了一个CString型的变量m_Edit1,如何当我在Edit box中输入字符串,例如1234后,按按钮,1234就背存
到了m_Edit1里面。
...全文
124 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
quanxiongwei 2002-05-14
  • 打赏
  • 举报
回复
将m_Edit绑定到IDC_EDIT1上

UpdateData(true);
tifaling 2002-05-14
  • 打赏
  • 举报
回复
首先,按ctrl+w--打开MFC Classwizard=>Member Variables属性框,选中IDC_EDIT1,单击Add Variables(右边按钮),设置变量名为m_edit(Category选Value,下一个是Cstring),单击ok.
然后在按钮按下事件中添加代码如下:
UpdateData(true);//执行这句后已经达到了目的
chengliang80 2002-05-14
  • 打赏
  • 举报
回复
消息处理函数是哪个?
__bluesky__ 2002-05-14
  • 打赏
  • 举报
回复
将m_Edit绑定到IDC_EDIT1上,然后在消息处理函数中用UpdateDate(true);
(好像是true,要不就是false,记不清楚了)
chengliang80 2002-05-14
  • 打赏
  • 举报
回复
你们的方法怎么都不灵呀?m_Edit1就是不变
feng_sky 2002-05-14
  • 打赏
  • 举报
回复
好象&也不要。
akademecia 2002-05-14
  • 打赏
  • 举报
回复
在button的点击事件中用:
GetWindowsItem(IDC_EDIT1)->GetWindowsText();

GetWindowsItem好像是这个函数,你查查
dyw 2002-05-14
  • 打赏
  • 举报
回复
1) 手工添加变量
GetDlgItem(IDC_EDIT1)->GetWindowText(&m_Edit1);
2) ClassWizard添加变量
UpdateData(FALSE);
MessageBox(m_Edit1);
ljp3000 2002-05-14
  • 打赏
  • 举报
回复
如果有用ClassWIzard把m_Edit1和IDC_EDIT1关联起来的话:
UpdateData(FALSE);

如果没有
GetDlgItem(IDC_EDIT1)->GetWindowText(...,..);
huanyun 2002-05-14
  • 打赏
  • 举报
回复
在按钮的处理中
UpdateWindow(TRUE)
feng_sky 2002-05-14
  • 打赏
  • 举报
回复
对不起。上面错了。
IDC__EDIT1.GetwindowsText(&m_edit1 );
feng_sky 2002-05-14
  • 打赏
  • 举报
回复

m_edit1 = IDC__EDIT1.GetwindowsText();
提取,编辑和轻松评估XPath查询。 XPath的助手很容易提取,编辑,并在任何网页评估XPath查询。 重要提示:安装此扩展后,必须重新加载任何现有的选项卡或重新启动Chrome浏览器扩展工作。 说明: 1.打开一个新的标签,并导航到任何网页。 2.按Ctrl-Shift键-X(或OS X命令移-X),或单击工具栏上的XPath的助手按钮,以打开XPath助手控制台。 3.按住Shift键将鼠标悬停在页面上的元素。查询框将不断更新,以显示鼠标指针下方的元件XPath查询,结果框将显示当前查询的结果。 4.如果需要,请在控制台直接编辑XPath查询。结果框会立即反映更改。 5.重复步骤(2)关闭控制台。 如果控制台在你的方式获得,按住Shift键,然后将鼠标移动到它; 它会移动到页面的相对侧。 一个忠告:当渲染HTML表格,浏览器插入人工标记到DOM,这将在随后通过该扩展提取查询显示出来。 Extract, edit, and evaluate XPath queries with ease. XPath Helper makes it easy to extract, edit, and evaluate XPath queries on any webpage. IMPORTANT: After installing this extension, you must reload any existing tabs or restart Chrome for the extension to work. Instructions: 1. Open a new tab and navigate to any webpage. 2. Hit Ctrl-Shift-X (or Command-Shift-X on OS X), or click the XPath Helper button in the toolbar, to open the XPath Helper console. 3. Hold down Shift as you mouse over elements on the page. The query box will continuously update to show the XPath query for the element below the mouse pointer, and the results box will show the results for the current query. 4. If desired, edit the XPath query directly in the console. The results box will immediately reflect your changes. 5. Repeat step (2) to close the console. If the console gets in your way, hold down Shift and then move your mouse over it; it will move to the opposite side of the page. One word of caution: When rendering HTML tables, Chrome inserts artificial tags into the DOM, which will consequently show up in queries extracted by this extension.

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧