Hi,
I am creating an application which will send the input string to mobile device. Some devices have problems with encoding special characters so I would like to create a filter which doesn't allow the user on PC to enter special characters.
The application is written in C# (.NET 3.5) and I would like to attach a method to key press event. The pseudocode is the following:
private void checkTextBoxContent(TextBox txtEntry)
{
if(txtEntry.Text contains non-ASCII sign)
{
show messageBox;
remove the last entered character;
}
}
Does anyone know if there is any existing method that detects ASCII/non-ASCII sign so that could be used in condition
txtEntry.Text contains non-ASCII sign?
Thank you!