Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 7:25
Mark Salsbery7-Apr-08 7:25 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 7:34
CrocodileBuck7-Apr-08 7:34 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 7:44
Mark Salsbery7-Apr-08 7:44 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 7:31
CrocodileBuck7-Apr-08 7:31 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 7:44
Mark Salsbery7-Apr-08 7:44 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 7:49
CrocodileBuck7-Apr-08 7:49 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 7:53
CrocodileBuck7-Apr-08 7:53 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 8:02
Mark Salsbery7-Apr-08 8:02 
<font color="Green">// MyEdit.h</font>

#pragma once

class CMyEdit : public CEdit
{
    DECLARE_DYNAMIC(CMyEdit)

public:
    CMyEdit();
    virtual ~CMyEdit();

protected:
    DECLARE_MESSAGE_MAP()
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};


<font color="Green">////////////////////////////////////////////////////////////////////////</font>

<font color="Green">// MyEdit.cpp</font>


#include "stdafx.h"
#include "MyEdit.h"

IMPLEMENT_DYNAMIC(CMyEdit, CEdit)

CMyEdit::CMyEdit() : CEdit()
{
}

CMyEdit::~CMyEdit()
{
}

BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
    ON_WM_CHAR()
END_MESSAGE_MAP()


void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    if (nChar == VK_RETURN) 
    {
        <font color="Green">// do stuff!</font>

        return;
    }

    CEdit::OnChar(nChar, nRepCnt, nFlags);
}

 





Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 8:14
CrocodileBuck7-Apr-08 8:14 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 8:31
Mark Salsbery7-Apr-08 8:31 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 8:47
CrocodileBuck7-Apr-08 8:47 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 9:01
Mark Salsbery7-Apr-08 9:01 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 9:22
CrocodileBuck7-Apr-08 9:22 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 9:30
CrocodileBuck7-Apr-08 9:30 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 9:36
Mark Salsbery7-Apr-08 9:36 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 9:45
CrocodileBuck7-Apr-08 9:45 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 10:00
Mark Salsbery7-Apr-08 10:00 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
led mike7-Apr-08 10:04
led mike7-Apr-08 10:04 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
Mark Salsbery7-Apr-08 10:11
Mark Salsbery7-Apr-08 10:11 
GeneralRe: How to get datas from an edit control (in the toolbar) by pressing return (enter) ? Pin
CrocodileBuck7-Apr-08 10:59
CrocodileBuck7-Apr-08 10:59 
Generala problem when wait for a thread to be completed Pin
followait7-Apr-08 5:30
followait7-Apr-08 5:30 
QuestionRe: a problem when wait for a thread to be completed Pin
David Crow7-Apr-08 6:05
David Crow7-Apr-08 6:05 
GeneralRe: a problem when wait for a thread to be completed Pin
followait7-Apr-08 7:37
followait7-Apr-08 7:37 
GeneralRe: a problem when wait for a thread to be completed Pin
David Crow7-Apr-08 8:10
David Crow7-Apr-08 8:10 
GeneralRe: a problem when wait for a thread to be completed Pin
Jim Crafton7-Apr-08 9:24
Jim Crafton7-Apr-08 9:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.