views:

688

answers:

2

I'm trying to duplicate the following behavior (WM6).

Go to Settings -> About -> Device ID. The Device Name textbox gets the focus, causing the onscreen keyboard to pop up.

I'd like to be able to do the same in my application, preferably in managed code.

+5  A: 

The onscreen keyboard is in the Microsoft.WindowsCE.Forms namespace.

Add a project reference to that and you'll have the InputPanel control available, add one of those to your form then in your code behind.

private void txtField_GotFocus(object sender, EventArgs e)
{
     //Enabled == show
     inputPanel.Enabled = true;
}

private void txtField_LostFocus(object sender, EventArgs e)
{
     inputPanel.Enabled = false;
}
TreeUK
Thanks, works like a charm. Who could imagine the keyboard was called InputPanel? :)
Dmitry Shechtman
A: 

I would add that you also need to instantiate an instance of the Microsoft.WindowsCE.Forms.InputPanel class for your project (in addtion to adding a reference to the namespace as noted by TreeUK).

The easiest way to do this is to drag an InputPanel control onto your Windows Form in Design mode. Whatever you name your InputPanel instance would be what you reference in the event handlers for your form fields.

CBono