T
Thomas Wang
I have a sample:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar<255)
e.Handled = true;
}
above code can prevent ASCII code when I pressed.
but I wonder how I can prevent Chinese characters Key in ? because:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar>255)
e.Handled = true;
}
can not work properly when I key in. What can i do ?
B.Rgds
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar<255)
e.Handled = true;
}
above code can prevent ASCII code when I pressed.
but I wonder how I can prevent Chinese characters Key in ? because:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar>255)
e.Handled = true;
}
can not work properly when I key in. What can i do ?
B.Rgds