string strLength = TextBox1.Text;
MessageBox.Show("Number of Characters: " + strLength.Length.ToString());
using System.Diagnostics; using System; using System.Windows.Forms; using System.Collections; using System.Drawing; using Microsoft.VisualBasic; using System.Data; using System.Collections.Generic; namespace Count_Number_of_Characters { public partial class Form1 { public Form1() { InitializeComponent(); if (defaultInstance == null) defaultInstance = this; } public void Button1_Click(System.Object sender, System.EventArgs e) { string strLength = TextBox1.Text; MessageBox.Show("Number of Characters: " + strLength.Length.ToString()); } } }