简体   繁体   中英

Pressing enter to do same action as double click does in wpf image button

I have created an image button which does something if double-clicked. I want pressing enter also to do the same thing. How can I do that?

如果是WPF按钮,则执行IsDefault="True"并安装常规的单击处理程序。

您可以使用KeyDown事件检查e.Key == Keys.Enter然后调用双击使用的相同函数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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