CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    How to get Enter message in the edit control box??

    I want to change the data and display when I hit enter in the edit control box in the dialog. Is there any way I can do that??

    Thanks.
    Amy


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: How to get Enter message in the edit control box??

    You must predefine your OnOK() function first so that it won't close your dialog every time you press Enter like that CMyDialog::OnOK() {}
    Just define OnClickedOK() for example. After that handle the message WM_CHAR and do you stuff in OnChar();



  3. #3
    Join Date
    Apr 1999
    Posts
    16

    Re: How to get Enter message in the edit control box??

    Another way...
    Derive new class from class CEdit

    class CMyEdit : public CEdit
    {
    ...
    afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );

    }

    and overwrite there virtual function : OnChar
    inside this function check if enter was pressed

    But u wont be able to set this control using
    Class Wizard... U ll need to set it in : OnInitDialog function or :OnInitialUpdate



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured