How to count characters and limit the character to 15(windows application) [Resolved]

Posted by Amulya under Visual Studio on 5/14/2013 | Points: 10 | Views : 989 | Status : [Member] | Replies : 1
I need when I put some character in textbox in label control it will show the count. And when the count is 15 it do not takes any character in textbox.




Responses

Posted by: Satyapriyanayak on: 5/14/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Try

private void textBox1_TextChanged(object sender, EventArgs e)
{
textBox1.MaxLength= 15;
lblCount.Text = "Total characters are: " + textBox1.Text.Length;
}

If this post helps you mark it as answer
Thanks

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response