private void textBox1_KeyPress( object sender, KeyPressEventArgs e)
{
e . Handled = char . ToUpper(e . KeyChar) == 'D' ;
}
// 消除字符的警告声
private void textBox1_KeyPress ( object sender , KeyPressEventArgs e)
{
e . Handled = (e . KeyChar == ( char ) 27 ) || (e . KeyChar == ( char ) 13 );
}