// For Syntax Highlighter
Welcome to MSDN Blogs Sign in | Join | Help

Mike Ormond's Blog

In my world, things would be simpler than this...

News

  • Add to Technorati Favorites

    These postings are provided "AS IS" with no warranties, and confer no rights. The use of any script / code samples is subject to the terms specified here.

Compact Framework - Setting the input mode to “numeric”

For certain fields in my application, I want to set the input mode (usually to numeric – eg for the distance, final mileage and date fields numeric makes most sense). This makes a *big* difference to the experience on the SmartPhone so take the time and trouble to set input mode where it makes sense. This requires a bit of interop as the Compact Framework does not provide a direct mechanism to do this. The following MSDN articles show you how to change the input mode.

I adopted the latter of the two approaches which wraps up the interop in a SetInputMode method so you can simply do something like:

InputMode.SetInputMode(txtDistance, InputMode.Mode.Numbers);

And that will set the input mode of the txtDistance TextBox to numeric. Very neat.

Posted: Wednesday, August 09, 2006 4:55 PM by MikeOrmond

Comments

No Comments

New Comments to this post are disabled
Page view tracker