winforms - Visual Studio c# Key press enter not working -


hey guys i've been struggling code ! did research , don't understand why code isn't working... please !

private void checkenter(object sender, system.windows.forms.keypresseventargs e)     {         if (e.keychar == (char)13)         {             debug.writeline("it's working!");             enterkey = true;         }         else         {             enterkey = false;         }     }      private void textbox_textchanged(object sender, textchangedeventargs e)     {         debug.writeline("the text changing");          if (enterkey == true)         {             encryptkey = encryptintextbox.text;             debug.writeline("the key " + encryptkey);         }     } 

apparently can't change 'textchangedevenargs' because of how text box created, whenever change it, comes error. so, decided way, !

why don't check enter key directly textbox keypress or keyup event?


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -