开发者

Visual Studio 2010 C# .NET textbox restrictions

开发者 https://www.devze.com 2022-12-30 02:18 出处:网络
if user entered \"!\" \"?\" \",\" in te开发者_StackOverflow中文版xtbox and press button, this person see ERROR message in label.

if user entered "!" "?" "," in te开发者_StackOverflow中文版xtbox and press button, this person see ERROR message in label. how can make that? and what is the code?


in the button click handler do:

if (textbox.text.contains("!") || textbox.text.contains("?") || textbox.text.contains(",")){
     //display error message code
     label.text = "ERROR";
}
0

精彩评论

暂无评论...
验证码 换一张
取 消