I want to show and hide the OSK keyboard (docked at the bottom) for my touch screen application best methods? (I want to make sure when I show that I try to run, in case someone closed it while using the app)
Printable View
I want to show and hide the OSK keyboard (docked at the bottom) for my touch screen application best methods? (I want to make sure when I show that I try to run, in case someone closed it while using the app)
make a button or menu strip as u wish and call it what u wish
and use this code
Works like charmCode:Shell("cmd.exe /c start osk")
What about hiding the OSK?
The user will close it or minimize it
Simplest.
Use process to get the id of the osk and close it.
As always, you should use Process.Start in preference to Shell. We're using VB.NET now so let's use VB.NET.vb.net Code:
Public Class Form1 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 End Class
Mine Opens, but does not close. I don't actually need to close it, I could minimize it or something too. I also realize now that the OSK isn't the same keyboard used in the Tablet PC input panel. The one in the Tablet PC input panel is better :-/
the tablet OSK is:
Me.oskProcess = Process.Start("C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe")