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

    Enter Key Pressed

    Hi
    Would anybody be able to give me an example of knowing in my view class when the enter key is pressed????
    Thank!!!!!!


  2. #2
    Join Date
    May 1999
    Posts
    8

    Re: Enter Key Pressed

    For example,

    void CExampleView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
    {
    // TODO: Add your message handler code here and/or call default
    if (nChar == VK_RETURN)
    {
    // Do somthing
    }

    CView::OnKeyDown(nChar, nRepCnt, nFlags);
    }

    Or

    void CExampleView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
    {
    // TODO: Add your message handler code here and/or call default
    if (nChar == VK_RETURN)
    {
    // Do somthing
    }

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

    Hope any help to you.


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