c# - Event before pressing a key or barcode scanner -
how this? example:
- i have
textbox1
, input "someinput" leavetextbox1
. (input using keyboard or barcode scanner) - when return
textbox1
"someinput" highlightedtextbox1.selectall()
. - when press key "someinput" changed key press. (or use barcode scanner)
now, how would insert "someinput"(the input before key press) in textbox3
?
i tried textchanged
event insert new key pressed.
private void textbox1_textchanged(object sender, eventargs e) { textbox3.text = textbox1.text; }
focus
event not allowed.
another question: textchanged occur when barcode scanned?
assuming select text in textbox1
focus gets over,writing code in textbox1.enter
might achieve need;
private void textbox1_enter(object sender, eventargs e) { if (textbox1.selectedtext.length == textbox1.textlength) { textbox3.text = textbox1.text; textbox1.text = ""; } }
Comments
Post a Comment