Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
据我所知,这不是正则表达式。而且我找不到量词的任何地方。这就是我现在所拥有的,MaskedTextBox 无法将 + 识别为量词
A+
您正试图过早地验证被屏蔽的文本框。在没有输入之前,您无法知道它没有任何输入。我假设您有某种表格,让用户填写,最后他们按下按钮来完成数据输入。您可以验证该事件中的输入。
如果您只是想确保非空,那么您可以TextLength在焦点离开文本框后或按下按钮时等检查该字段。
TextLength