Click to See Complete Forum and Search --> : Moving to next field on <RETURN>


Steve McNeese
April 9th, 1999, 10:14 AM
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
steven.mcneese@boeing.com

Thomas Wiesinger
April 9th, 1999, 12:28 PM
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

Rail Jon Rogut
April 9th, 1999, 01:55 PM
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
railro@earthlink.net
http://home.earthlink.net/~railro/