PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2010 Show/Hide On Screen Keyboard (OSK, Touchscreen)-VBForums
Results 1 to 8 of 8

Thread: Show/Hide On Screen Keyboard (OSK, Touchscreen)

  1. #1

    Thread Starter
    Member intellilogic's Avatar
    Join Date
    Oct 2010
    Location
    Tyson's Corner, VA
    Posts
    39

    Question Show/Hide On Screen Keyboard (OSK, Touchscreen)

    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)

  2. #2
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    make a button or menu strip as u wish and call it what u wish
    and use this code
    Code:
    Shell("cmd.exe /c start osk")
    Works like charm

  3. #3

    Thread Starter
    Member intellilogic's Avatar
    Join Date
    Oct 2010
    Location
    Tyson's Corner, VA
    Posts
    39

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    What about hiding the OSK?

  4. #4
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    The user will close it or minimize it

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,613

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    Simplest.
    Use process to get the id of the osk and close it.
    Slow as hell.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,892

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    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:
    1. Public Class Form1
    2.  
    3.     Private oskProcess As Process
    4.  
    5.     Private Sub openButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles openButton.Click
    6.         If Me.oskProcess Is Nothing OrElse Me.oskProcess.HasExited Then
    7.             If Me.oskProcess IsNot Nothing AndAlso Me.oskProcess.HasExited Then
    8.                 Me.oskProcess.Close()
    9.             End If
    10.  
    11.             Me.oskProcess = Process.Start("osk")
    12.         End If
    13.     End Sub
    14.  
    15.     Private Sub closeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closeButton.Click
    16.         If Me.oskProcess IsNot Nothing Then
    17.             If Not Me.oskProcess.HasExited Then
    18.                 'CloseMainWindow would generally be preferred but the OSK doesn't respond.
    19.                 Me.oskProcess.Kill()
    20.             End If
    21.  
    22.             Me.oskProcess.Close()
    23.             Me.oskProcess = Nothing
    24.         End If
    25.     End Sub
    26.  
    27. End Class
    Last edited by jmcilhinney; Oct 31st, 2010 at 12:27 AM.

  7. #7

    Thread Starter
    Member intellilogic's Avatar
    Join Date
    Oct 2010
    Location
    Tyson's Corner, VA
    Posts
    39

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    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 :-/

  8. #8
    New Member
    Join Date
    Dec 2015
    Posts
    2

    Re: Show/Hide On Screen Keyboard (OSK, Touchscreen)

    the tablet OSK is:
    Me.oskProcess = Process.Start("C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width