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
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
Post a Comment