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.
如果用户输入“!” “?” “,”在文本框中并按下按钮,此人会在标签中看到错误消息。怎么能做到呢?什么是代码?
在按钮单击处理程序中执行:
if (textbox.text.contains("!") || textbox.text.contains("?") || textbox.text.contains(",")){ //display error message code label.text = "ERROR"; }