Software based input panel (soft keyboard on WinCE 4.0) .NET programming

Posted on 2006-04-11
Last Modified: 2008-01-09
Below is the code I have written to test showing the soft keyboard and then to hide it when done "typing" in the text box.  However I get an error in the code when running on the device on this line "Showkeyboard = SipShowIM(1)".  Thanks for the help.

Public Class test
    Inherits System.Windows.Forms.Form
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Declare Function SipShowIM Lib "coredll" (ByVal flags As Long) As Long

#Region " Windows Form Designer generated code "

    Public Sub New()

        'This call is required by the Windows Form Designer.

        'Add any initialization after the InitializeComponent() call

    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    End Sub

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.Button1.Location = New System.Drawing.Point(32, 56)
        Me.Button1.Size = New System.Drawing.Size(64, 24)
        Me.Button1.Text = "Keybd on"
        Me.Button2.Location = New System.Drawing.Point(32, 88)
        Me.Button2.Size = New System.Drawing.Size(64, 24)
        Me.Button2.Text = "Keybd off"
        Me.TextBox1.Location = New System.Drawing.Point(16, 16)
        Me.TextBox1.Size = New System.Drawing.Size(96, 22)
        Me.TextBox1.Text = ""
        Me.ClientSize = New System.Drawing.Size(244, 274)
        Me.Text = "test"

    End Sub

#End Region

    Private Function Showkeyboard() As Long
        Showkeyboard = SipShowIM(1)
    End Function

    Private Function Hidekeyboard() As Long
        Hidekeyboard = SipShowIM(0)
    End Function
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    End Sub
End Class
Question by:rbpart4
    1 Comment
    LVL 14

    Accepted Solution

    I think you don't need to call the SipShowIM() API. You can add an instance of the System.WindowsCE.Forms.InputPanel class (also included in the toolbox) to your form. Now, to show/hide the input panel, set the Enabled property of the control.


      Nayer Naguib

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now