| Eric W 2005-05-18, 9:00 pm |
| How can I make use of the T9 and Abc features of form input. I have used
the examples on MSDN to acheive t9 and abc, but how can i capitalise the
first letter ?
so that i can acheive: "Mytext" instead of "mytext"
// Interop declarations
[DllImport("coredll.dll", EntryPoint="GetCapture")]
private static extern IntPtr GetCapture();
[DllImport("coredll.dll", EntryPoint="GetWindow")]
private static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
[DllImport("coredll.dll", EntryPoint="SendMessage")]
private static extern uint SendMessage(IntPtr hWnd, uint msg, uint wParam,
uint lParam);
// Constants required for interop
const int GW_CHILD = 5;
const uint EM_SETINPUTMODE = 0x00DE;
public static void SetInputMode(Control ctrl, InputMode mode) {
// Get the handle for the current control
ctrl.Capture = true;
IntPtr h = GetCapture();
ctrl.Capture = false;
// Get the child window for the control
IntPtr hEditbox = GetWindow(h, GW_CHILD);
// Set the input mode
SendMessage(hEditbox, EM_SETINPUTMODE, 0, (uint)mode);
}
// Input mode enumeration
public enum InputMode {
Spell = 0,
T9 = 1,
Numbers = 2,
Text = 3
}
|