1
Reply

Help with keypress evetn handler

mark jones

mark jones

Apr 25 2006 6:43 AM
1.9k

Am currently trying to create code that clears a text box after a message box is shown when a nonnumeric digit is entered.  The code am using doesnt clear the text field as shown below:

if(Char.IsDigit(e.KeyChar) == false)
   {
    txtStudID.Focus();
    txtStudID.Text = "";
               MessageBox.Show("Please enter a numeric value to continue");
              
    
   } 

Thanks for any help


Answers (1)