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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -