You know, the more I delve into .NET the more frustrating it gets!! on the keypress event of a textbox i want to make sure that any characters that are not numbers are ignored. I have sat for an hour looking through the help but as usual Microsoft never acatually provide real-world examples in their help! In previous versions of VB I could use sendKeys to send a single backspace character to delete that last character entered, but in VB.NET SendKeys seems to hang the application!

The code is as follows in the keypress handler for my Textbox

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Not Char.IsDigit(e.KeyChar) Then
'What do I put here to make sure that the character
'I just typed doesn't get displayed in my textbox
End If
End Sub

Oh, I don't want to use Validating event handlers or the like to go about this another way - just want to know is there something I can put in the if statement above to achieve what I'm looking for.