c# - How to open new form when Enter as Tab? -


when press enter button, acts tab code @ form1_keydown event

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

there comboboxin form press enter button open new form.
how because doesn't work on cmb_keypressevent

here can wirte as:

 control nextcontrol;   if (e.keycode == keys.enter)  { nextcontrol = getnextcontrol(activecontrol, !e.shift); nextcontrol.focus(); if(nextcontrol=combo) { keypreview=false;    } 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 -