This code works fine only if I comment out the MessageBox.Show().
private void textBox1_KeyDown( object sender, KeyEventArgs e ) {
if( textBox1.Text.Contains('.') && ( e.KeyCode == Keys.Decimal || e.KeyCode == Keys.OemPeriod ) ) {
MessageBox.Show("More than one decimal point!");
e.SuppressKeyPress = true;
}
}
What is the reason? and How can I alert the User?
EDIT
Then How can I alert for the wrong Key Press?