如何显示/隐藏Windows虚拟键盘 [英] how to show/hide windows Virtual keyboard

查看:451
本文介绍了如何显示/隐藏Windows虚拟键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在VB.Net中设计一个可在平板电脑上运行的应用程序.
我的应用程序中需要一个虚拟键盘,可以通过单击按钮或某些快捷方式来激活它.

谁能告诉我如何使用Windows虚拟键盘?如何显示/隐藏键盘?

任何帮助将不胜感激.

问候
Nitin

Hi All,

I am designing an application in VB.Net which would run on the tablet PC.
I need a virtual keyboard in my application which can activated on the click of a button or some shortcut.

Can anybody tell how can I make use the windows virtual keyboard? How to show/hide the keyboard?

any help would be much appreciated.

Regards
Nitin

推荐答案

如果您正在谈论虚拟键盘COM组件,请 ^ ]包含一些信息.
If you are talking about the Virtual Keyboard COM component, then this[^] has some info.


我刚刚尝试了以下操作,效果很好;

I have just tried the following and it works fine;

Public Class Form1
    Private OSK As System.Diagnostics.Process
Private Sub ButtonShowOSK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonShowOSK.Click
        'Create the OSK Process
    OSK = System.Diagnostics.Process.Start("osk.exe")
End Sub

Private Sub ButtonKillOSK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonKillOSK.Click
    Try
        OSK.Kill()
    Catch ex As Exception
        Debug.WriteLine(ex.Message)
    End Try
End Sub
End Class



注意1:OSK进程具有CloseMainWindow()方法,但是,它返回true,表示成功,但是OSK仍在运行.

注意2:OSK进程具有Close()方法,但没有任何反应.

因此,KILL方法有效!



Note1: the OSK process has a CloseMainWindow() method, however, it returns true, indicating success, but the OSK remains running.

Note2: the OSK process has a Close() method, but nothing hapens.

So, the KILL method works!


我最近回答了相关问题;这里讨论了一个重要的问题:应用程序焦点的得失 [ ^ ].

—SA
I recently answered related Question; there is one important issue discussed here: Application focus getting and losing[^].

—SA


这篇关于如何显示/隐藏Windows虚拟键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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