Code: C#
if(Char.IsDigit(e.KeyChar) == false)
{
txtStudID.Focus();
txtStudID.Text = "";
MessageBox.Show("Please enter a numeric value to continue");
}
|
Go4Expert Member
|
|
| 25Apr2006,16:17 | #1 |
|
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:
Code: C#
Last edited by shabbir; 25Apr2006 at 20:53.. Reason: Proper formating |
|
Go4Expert Founder
|
![]() |
| 25Apr2006,20:54 | #2 |
|
Does it show the message box.
|
|
Team Leader
|
![]() |
| 29Jan2007,17:27 | #3 |
|
Oh! A simple fix on line 7 would fix that, change line 7 to this
Code: javascript
|