如何实现按钮单击事件的键事件 [英] How to implement key event for button click event
问题描述
大家好!
我正在编写虚拟键盘,但遇到了问题.
如我们所知,当按下真实键盘上的一个键时,焦点对准的控件将收到键事件
我不想编写代码句柄,我想发送文本框的键码,而文本框将使用此键码执行操作.
例如:当您按Enter键时,您将重点放在多行"文本框中.文本框将添加1行,并在该行显示光标.
.Textbox将收到Enter的键控代码,此文本框将使用此Enter键控代码执行1个操作.
所以现在我想知道如何从按钮的单击事件中实现键事件.
请帮我!谢谢!!!
亲切的问候.
Sugia
Hi everybody!
I''m writing a virtual keyboard, and i have a problem.
As we know when press a key on real keyboard, control which focused will receive key event
i don''t want to writing code handle, i want to send keycode for textbox, and textbox will perform a action with this keycode.
Ex: you focus in a Multi line textbox, when you press key Enter. textbox will add 1 line and show cursor at that line.
.Textbox will receive Enter ''s key code , after that textbox will perform 1 action with this Enter keycode.
so now i want to know that how to implement key event from buttton click event for a control.
Please help me! Thanks!!!
Kind regards.
Sugia
推荐答案
您想使用哪种语言?我假设使用C#,因为您已经对其进行了标记.
请参阅这篇文章:触摸屏键盘用户控件 [
And which language are you wanting to do it in? I''m presuming C#, because you''ve tagged it so.
See this article: Touchscreen Keyboard UserControl[^]
这篇关于如何实现按钮单击事件的键事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!