| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1936 人关注过本帖
标题:[求助](在线等待)编译出错
只看楼主 加入收藏
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 

Called when the user clicks the OK button (the button with an ID of IDOK).
virtual void OnOK( );
Remarks
Override this member function to perform the OK button action. If the dialog box includes automatic data validation and exchange, the default implementation of this member function validates the dialog-box data and updates the appropriate variables in your application.
If you implement the OK button in a modeless dialog box, you must override the OnOK member function and call DestroyWindow from within it. Don't call the base-class member function, because it calls EndDialog, which makes the dialog box invisible but does not destroy it.
Example
/* MyDialog.cpp */
#include "MyDialog.h"

void CMyDialog::OnOK()
{
// TODO: Add extra validation here

// Ensure that your UI got the necessary input
// from the user before closing the dialog. The
// default OnOK will close this.
if ( m_nMyValue == 0 ) // Is a particular field still empty?
{
AfxMessageBox("Please enter a value for MyValue");
return; // Inform the user that he can't close the dialog without
// entering the necessary values and don't close the
// dialog.
}

CDialog::OnOK(); // This will close the dialog and DoModal will return.
}

2006-04-27 11:44
liyunhw
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-4-27
收藏
得分:0 
不是改了好懂一些吗?
OK总比BUTTON1明白意思一些
2006-04-27 11:45
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 
刚在msdn里找到的看来是有这个函数的不过控件ID得要是IDOK才行。真是万分抱歉我以为没有呢。耽误你时间了。
2006-04-27 11:48
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 
一般来说ID其实随你起个名字没关系的,ID_BUTTON也好,ID_OK也好,关键是那个数值。不过这里特殊好像一定要用ID_OK.

[此贴子已经被作者于2006-4-27 11:53:37编辑过]


2006-04-27 11:53
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 
怎么着帖子不能改刚才错了是IDOK
2006-04-27 11:55
liyunhw
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-4-27
收藏
得分:0 

就是说我一定要把登录按钮的ID改为ID_OK?
我现在又重新做过,还想不改ID了呢?
不行吗?用默认的?

2006-04-27 11:56
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 
IDOK没下划线的.
2006-04-27 11:58
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 
你现在用什么ID?不是ID_OK吗,改成IDOK试一下
2006-04-27 12:00
liyunhw
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-4-27
收藏
得分:0 
哦,谢谢,
2006-04-27 12:00
jedimaster
Rank: 1
等 级:新手上路
帖 子:117
专家分:0
注 册:2006-3-31
收藏
得分:0 
这个论坛的帖子不能编辑吗?我用FIREFOX的.连粘贴都不行要改用IE才行
2006-04-27 12:02
快速回复:[求助](在线等待)编译出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016778 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved