开发者

Visual Studio 2010 C# .NET textbox restrictions

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜