ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

SetInputScope

Set the InputScope of TextBox on a Windows 7 Phone.

Source

public static class Extensions {

    public static void SetInputScope(this TextBox tb, InputScopeNameValue inputScopeNameValue) {
        tb.InputScope = new System.Windows.Input.InputScope() {
            Names = { new InputScopeName() { NameValue = inputScopeNameValue } }
        };
    }
}

Example

textBoxAmount.SetInputScope(InputScopeNameValue.Number);

Author: Fons Sonnemans

Submitted on: 21 mei 2010

Language: C#

Type: System.Windows.Controls.TextBox

Views: 6228