Created
January 22, 2019 22:37
-
-
Save MartinZikmund/b525954405a5d842a555040fa6c9d0c7 to your computer and use it in GitHub Desktop.
Number-only TextBox Filtering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void TextBox_OnTextChanging(TextBox sender, TextBoxTextChangingEventArgs args) | |
{ | |
sender.Text = new String(sender.Text.Where(char.IsDigit).ToArray()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment