CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    51

    Moving to next field on <RETURN>

    I have an application that accepts input from a barcode scanner. The scanner, like most scanners, is configured to send a CR and the end of the barcode data. The CR is ignored in my edit box. I turned on the want return option to see if the CR would be retained in the data when doing a GetDlgItemText, but it did not pass to the CString object. What I want to be able to do is capture the CR during input and issue a GotoDlgCtrl(GetDlgItem(IDC_MYNEXTCONTROL)); How can this be accomplished? I know that the EN_CHANGE message is sent on every keystroke. Does the CR pass?

    Thanks,

    Steve

    Steven M. McNeese
    [email protected]

  2. #2
    Join Date
    Apr 1999
    Posts
    5

    Re: Moving to next field on <RETURN>

    Hm, to avoid sub-classing (and responding to cr there ), you could create a default button in your dialog, which is doing the switching for you. on &lt;enter&gt; your default button gives a WM_COMMAND. btw. I guess the ES_WANTRETURN has to be turned off again in this case

    Hope this helps,

    Thomas


  3. #3
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: Moving to next field on <RETURN>

    For two methods to achieve this, go to my web site and download Example 5 on my MFC Examples page (http://home.earthlink.net/~railro/mfc_link.html).

    Rail

    Recording Engineer/Software Developer
    Rail Jon Rogut Software
    [email protected]
    http://home.earthlink.net/~railro/

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