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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -