如何计算文本框中的字符? [英] How can i count the characters in a textbox?
本文介绍了如何计算文本框中的字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要知道如何计算文本框中的字符.在我的应用程序中,我需要实现如果count小于5则显示错误.
i need know how can i count the characters in a textbox. In my application i need to implement that if count is less than 5 show error.
How can i count the characters in a textbox?
推荐答案
if(TextBox.Text.Length < 5)
{
//do whatever
}
if(TextBox1.Text.Lenght>5)
{
MessageBox.Show("Blah Blah Blah !!!");
}
这篇关于如何计算文本框中的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文