If you ever used TextBox control in smart phone application, you may found a bit confusing that input mode is selected to numbers. Entering alphabetic strings is then quite uncomfortable. Solution for this behavior is already included in .NET Compact Framework, but not so many coders knows about it.
InputModeEditor
Microsoft.WindowsCE.Forms namespace contains class
InputModeEditor with single static method
SetInputMode that takes two arguments. First parametr is the object that takes the input (usually TextBox), second one is the enumeration
InputMode which contains values like AlphaABC, AlphaT9, Numeric etc..
Usage is obvious:
using Microsoft.WindowsCE.Forms;
......
InputModeEditor.SetInputMode(textBox1, InputMode.AlphaABC);
[1] Alternative solution
Instead try using this alternative....
public void SetKeyboardMode(SHIME_MODE mode)
{
Process p = Process.GetCurrentProcess();
if (p.MainWindowHandle != IntPtr.Zero)
SHSetImeMode(p.MainWindowHandle, mode);
}
private enum SHIME_MODE
{
SHIME_MODE_NONE = 0,
SHIME_MODE_SPELL = 1,
SHIME_MODE_SPELL_CAPS = 2,
SHIME_MODE_SPELL_CAPS_LOCK = 3,
SHIME_MODE_AMBIGUOUS = 4,
SHIME_MODE_AMBIGUOUS_CAPS = 5,
SHIME_MODE_AMBIGUOUS_CAPS_LOCK = 6,
SHIME_MODE_NUMBERS = 7,
SHIME_MODE_CUSTOM = 8
}
Then you just wire the GotFocus and LostFocus events of a textbox.