There is some textbox, you need to implement the prohibition of entering the minus sign until a space is entered. For example, if you need to manually enter data for an array of integers into the textbox, I want to avoid the like -5-6 (it is necessary to separate the array members with a space, but in this situation it turns out that -5-6 is one number)
- onePossible duplicate question: Restrict text input in the textbox to a specific character set - MSDN.WhiteKnight
- Do not prohibit it. Let the user enters as he likes. He can copy the finished data set from another location. And in this copied text there may be no spaces. The user will edit the text in place. And you do not allow it to him. / Do validation after the end of input. When the focus changes to another text box or when a button is pressed. Here then give the user a message that the data is invalid. - Alexander Petrov
|