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

    Catching the enter Key

    Hi
    I want to know everytime the user presses the enter key in my view class
    Can anybody help me?
    Thanks


  2. #2
    Join Date
    May 1999
    Location
    WA
    Posts
    65

    Re: Catching the enter Key

    Override the "PreTranslateMessage" function for the view class. In that function, enter the following code:

    if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ENTER )
    {
    return TRUE;
    }

    I don't remember if it's return TRUE or FALSE. Play with that value to see which one works, but the other code I'm positive about..

    Good luck..

    - Troy

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