c# - Event before pressing a key or barcode scanner -


how this? example:

  1. i have textbox1 , input "someinput" leave textbox1. (input using keyboard or barcode scanner)
  2. when return textbox1 "someinput" highlighted textbox1.selectall().
  3. 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.

enter image description here

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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -