知道在组合框的离开事件上按下enter [英] to know enter is pressed on leave event of combobox

查看:66
本文介绍了知道在组合框的离开事件上按下enter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c#

推荐答案

中,我怎么知道在组合框或文本框的离开事件上按下Enter键?可以在请假事件中解决问题.
You''d have to catch the keypress itself, not try to work it out in the leave event.


protected override bool ProcessDialogKey(Keys keyData)
{
   switch (keyData)
   {
      case Keys.Enter:
      case Keys.Space:
         return base.ProcessDialogKey(Keys.Tab);
   }
   return base.ProcessDialogKey(keyData);
}




我认为这链接 [ ^ ]将为您提供帮助




i think this link[^]will help you


,具体取决于您的具体要求
这可以帮助您:

http://stackoverflow.com/questions/5605561/navigation-in-winforms-using- enter-key [ ^ ]
depending on your specific requirement
this can help you:

http://stackoverflow.com/questions/5605561/navigation-in-winforms-using-enter-key[^]


这篇关于知道在组合框的离开事件上按下enter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆