.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Total Charecters

Posted By: Rama Krishna     Posted Date: August 14, 2009    Points:2   Category :C#
in textbox1 i entered some text,in textbox2 i want to display total no of charecters entered in textbox1

Responses
Author: Akhil Raj       [Moderator]      
Posted Date: August 14, 2009     Points: 5   

hi,
just call TextBox1.Text.Length and display in the TextBox2 in the textchanged event of TextBox1

Author: Syed Shakeer Hussain             
Posted Date: August 15, 2009     Points: 5   

Hi Krishana,
first select your textbox event.In Events double click on ' TextChanged 'event.and write the below code as follows.

private void txtmessage_TextChanged(object sender, EventArgs e)
{
if (txtmessage.Text.Length > 0)
{

txtcount.Text = txtmessage.Text.Length.ToString();
}
else
txtcount.Text = Convert.ToString(0);

}



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend