虚拟键盘(表格上的A-Z按钮) [英] virtual keypad (A-Z buttons on the form)

查看:143
本文介绍了虚拟键盘(表格上的A-Z按钮)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用vb.net 2.0设计用于平板电脑的Windows应用程序.
在我所有的表单上,我都希望表单本身具有A-Z和0-9键.
按下这些键中的任何一个,用户都可以在有光标的任何地方键入内容.
问题是如果我按下按钮,焦点将移至该按钮,从而使光标从输入控件中丢失.
谁能告诉我如何使我的按钮没有焦点,以使光标停留在输入控件上?
另外,如果还有其他方法可以使用.
我不应该使用虚拟键盘.

问候,
gopal



i am designing a windows application for tablet pc using vb.net 2.0.
On all my forms i want A-Z and 0-9 keys on the form itself.
On press of any of these keys user would be able to type anywhere where there is a cursor.
The problem is if i press the button the focus shifts to the button and thus losing the cursor from the input control.
Can anybody tell how can I make my buttons focusless so that the cursor remains on the input control?
Also if there is any other approach i can use.
I am not supposed to use the virtual keyboard.

regards,
gopal

推荐答案

我多次回答类似的问题,请参见:

应用程序焦点的得失 [在BACKSPACE按钮上编程 [
I answered similar questions several times, please see this:

Application focus getting and losing[^]
Programming on BACKSPACE button[^]

Sorry, the first Question is in C#, but if you want to get good help and code sample and you do .NET development without some understanding of C# you won''t get much help anyway.

—SA


这是文章触摸屏键盘UserControl [ ^ ]

还有另一种选择:
如何显示,关闭,移动或调整屏幕键盘大小 [平板电脑 a> [^ ]

WM_SETFOCUS [
Here is an article Touchscreen Keyboard UserControl[^]

There is also another alternative:
How to show, close, move or resize the On-Screen Keyboard[^] - if you are using a tablet, this shows how to interact with the windows wirtual keyboard ...

For more info on what''s available with windows take a look at Tablet PC[^]

WM_SETFOCUS[^] - wParam contains the handle of the previous focused window.

Handling the event by overriding
Protected Overridable Sub WndProc ( _
    ByRef m As Message _
)



供您控制.由于
Control.GotFocus事件 [ ^ ]确实不包括先前聚焦的窗口的句柄.

问候
Espen Harlinn



for your control. This may be required since Control.GotFocus Event[^] does not include the handle to the previously focused window.

Regards
Espen Harlinn


非常感谢您对我们的支持...
我的应用程序现已上线....
但是解决我的问题的方法很简单...

我使用按钮而不是按钮,并在单击该标签时使用了sendkeys.

问候
gopal
well guys thanx for all ur support...
my application is live now....
however the solution to my problem was quite simple...

Instead of buttons, i used labels and on the click of that label i used sendkeys.

Regards
gopal


这篇关于虚拟键盘(表格上的A-Z按钮)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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