c# - How to avoid selecting textbox value when press Enter? -


control nextcontrol; if (e.keycode == keys.enter) {          nextcontrol = getnextcontrol(activecontrol, !e.shift);     if (nextcontrol == null)     {         nextcontrol = getnextcontrol(null, true);     }     nextcontrol.focus();                    e.suppresskeypress = true;  } 

i have code act enter key tab when press enter key selecting textbox value in image

enter image description here

you can tell textbox select nothing

control nextcontrol;  if (e.keycode == keys.enter) {          nextcontrol = getnextcontrol(activecontrol, !e.shift);     if (nextcontrol == null)     {         nextcontrol = getnextcontrol(null, true);     }     nextcontrol.focus();      textbox box = nextcontrol textbox;     if (box != null)         box.select(box.text.length, 0);      e.suppresskeypress = true; } 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -