简体   繁体   English

.NET CF不要触发按钮单击返回

[英].NET CF Don't trigger button-click on return

I have ac# .net cf 3.5 application on windows mobile 6.5 我在Windows Mobile 6.5上有ac#.net cf 3.5应用程序

On a form there are several buttons with onclick-events . 在表单上,​​有几个带有onclick-events按钮。

How do I prevent the events from triggering, if they were sent by a return (on the software or hardware-keyboard) an not a "real" click? 如果事件是通过返回(在软件硬件键盘上)而非“真实”的点击发送的,那么如何防止事件触发?

Can I find out, which action sent the click-event? 我可以看出,该行动发出的点击事件?

There are three ways to prevent the Enter button to trigger Click. 有三种方法可以防止Enter键触发点击。

  • Make a dummy/hidden button as the AcceptButton of the form. 将一个虚拟/隐藏按钮作为表单的AcceptButton。 That way any Enter press would trigger that button instead. 这样,任何Enter键都将触发该按钮。

  • Change the event handler to trigger on MouseUp or MouseDown instead 将事件处理程序更改为在MouseUp或MouseDown上触发

  • Subscribe to GotFocus event and set it to Focus on other control instead. 订阅GotFocus事件,并将其设置为“专注于其他控件”。 That way it won't receive Enter event 这样就不会收到Enter事件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM