可能有id 为IDOK 的按扭控件了

解决方案 »

  1.   

    把你想要设成缺省功能的按钮(比如IDC_SEND,对于OnSend())设成Default Button按钮
    注意一个对话框里只能有一个
    对话框在建立的时候缺省的是把OK按钮设置成default的
      

  2.   

    我的意思是先要把OK按钮的Default Button属性去掉
      

  3.   

    我加了个onok函数,回车屏蔽了。
    可我想达到按回车和点发送按钮效果一样的目的
    ,如何?
      

  4.   

    在send按钮的属性里加上Default Button
      

  5.   

    m_Cedit1为CEdit
    BOOL CTempDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message==WM_KEYDOWN)
    {
    if(pMsg->wParam ==VK_RETURN&&GetFocus()==&m_Cedit1)
    {
    MessageBox("Enter!");
    return TRUE;
    }
    }
    return CDialog::PreTranslateMessage(pMsg);