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

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.