-
October 18th, 2012, 01:20 AM
#1
C++ builder 2007, scan in edit with barcode scanner
Goodmorning
I have a simple application with one edit inside. So the user in this edit use a barcode scanner and scan. I have the above code
if(Key == '\n' ||Key == '\r')
checkCustomer();
So when it scans everything is ok. but when the user put a number from keyboard or letter i want to bring a message to him to use scanner with else.
all the code is on
Edit1KeyDown event
-
October 18th, 2012, 02:56 AM
#2
Re: C++ builder 2007, scan in edit with barcode scanner
Originally Posted by Leite333
... I have the above code
But I don't see any code "above"!
Nor is there some code below! (well, two lines of some pseudo-code that do not make any sense!)
Victor Nijegorodov
-
October 19th, 2012, 01:31 AM
#3
Re: C++ builder 2007, scan in edit with barcode scanner
Goodmorning
Here is some code i wrote. No much things. I want the user to use a scanner barcode and scan on edit. If he use scanner everything is ok. but if he use keyboard copy paste letters on numbers i want to bring a message to use scanner. I wrote the above but its not right. I wrote this code onkeypress event of Edit.. any help?
#
if(Key == '\n' ||Key == '\r') {
MessageDlg("THANK YOU FOR USE SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
else
{
MessageDlg("TRY SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
Edit1->Clear();
Edit1->SetFocus() ;
}
#
-
October 19th, 2012, 02:31 AM
#4
Re: C++ builder 2007, scan in edit with barcode scanner
I don't see any "onkeypress" code here, nor is your code properly formatted!
Please, read the Announcement... first: http://forums.codeguru.com/announcement.php?f=9
Victor Nijegorodov
-
October 19th, 2012, 02:56 AM
#5
Re: C++ builder 2007, scan in edit with barcode scanner
if(Key == '\n' ||Key == '\r')
MessageDlg("THANK YOU FOR USE SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
else
{
MessageDlg("TRY SCANNER",mtInformation,TMsgDlgButtons()<<mbOK,0);
Edit1->Clear();
Edit1->SetFocus() ;
}
this is my code and its onkeypress event of edit1
you dont need to answer if you dont wanna help
Last edited by Leite333; October 19th, 2012 at 03:01 AM.
-
October 19th, 2012, 03:11 AM
#6
Re: C++ builder 2007, scan in edit with barcode scanner
Well, if you ignore all my requests to clarify your problem then I should give up.
Good luck!
Victor Nijegorodov
-
October 20th, 2012, 02:18 AM
#7
Re: C++ builder 2007, scan in edit with barcode scanner
Originally Posted by Leite333
I wrote the above but its not right.
Would you explain how you know that it's not right? Just what you do and what you get. Did you debug your code? Is the handler really fired?
Besides, you have to inspect the Key value and see what data comes in it. You really sure there must be '\n' or 'r' and not virtual key codes?
And the last but not least. There's no need to be rude with the people that are trying to help. If you see they fail to understand you, you re-phrase, or provide some more detailed description, but keep being nice.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|