如何通过“输入” KeyEventArgs的关键 [英] How to pass "Enter" key to KeyEventArgs
本文介绍了如何通过“输入” KeyEventArgs的关键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好
i有一个带有此标题的事件
Hello
i have an event with this header
private void keyEnterPressedOnBtn(object sender, KeyEventArgs e)
i希望从另一个地方将密钥传递给此函数
i尝试了这个
i want to pass enter key to this function from another place
i tried this
keyEnterPressedOnBtn(null, System.Windows.Forms.SendKeys.Send("{ENTER}"));
但我有错误
help我:)
but i have error
help me :)
推荐答案
keyEnterPressedOnBtn(null,new KeyEventArgs(Keys.Enter));
keyEnterPressedOnBtn(null, new KeyEventArgs(Keys.Enter));
尝试这个 [ ^ ]
它可以帮助您了解更多
Try this[^]
It may help you to understand more
这篇关于如何通过“输入” KeyEventArgs的关键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文