我需要从windows 8(desktop winform.net)下的程序关闭tabtip键盘。
我发现需要时可以打开它,运行tabtip.exe来显示Windows8触摸键盘,但我不能在需要时关闭它!
我试着用process.kill来终止进程,但它不起作用,有人知道怎么做吗?
当做
让-克劳德

最佳答案

尝试以下操作-用tabtip替换osk
公共课表格1

Private oskProcess As Process

Private Sub openButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles openButton.Click
    If Me.oskProcess Is Nothing OrElse Me.oskProcess.HasExited Then
        If Me.oskProcess IsNot Nothing AndAlso Me.oskProcess.HasExited Then
            Me.oskProcess.Close()
        End If

        Me.oskProcess = Process.Start("osk")
    End If
End Sub

Private Sub closeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closeButton.Click
    If Me.oskProcess IsNot Nothing Then
        If Not Me.oskProcess.HasExited Then
            'CloseMainWindow would generally be preferred but the OSK doesn't respond.
            Me.oskProcess.Kill()
        End If

        Me.oskProcess.Close()
        Me.oskProcess = Nothing
    End If
End Sub

结束类

08-06 13:09