Wednesday, January 5, 2011

Restrict Special symbol in TextBox in C#

  private void ctlUL_KeyPress(object sender, KeyPressEventArgs e)
        {
            try
            {
                if (!char.IsLetterOrDigit(e.KeyChar) && e.KeyChar!=8 )
                {
                    e.Handled = true;
                    return;
                }
         }

No comments:

Post a Comment

Followers

Visitor No

click for free hit counter
Download a free hit counter here.