In windows Application we want to check empty space paste the below coding in your .cs page...
for example
Name Field: " Mano kumar"
Here 2 spaces . so we want to find put below lines.....
if(TextBox1.Text.Contains(""))
{
MessageBox.Show("Please Enter Name without Space");
}
read more...