Advertisement

12.17.2007 at 01:20AM PST, ID: 23027422
[x]
Attachment Details

VB 2005 KeyPress - backspace

Asked by murbro in .Net Editors & IDEs, Microsoft Visual Basic.Net, Visual Studio .NET 2005

Tags: vb, 2005, backspace, keypress

Hi

I have a text box that only numbers can be put into as represented by the following code. I also want to allow backspaces but am not sure what number this would be

    Private Sub txtAnchorFindInstanceOf_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAnchorFindInstanceOf.KeyPress
        If e.KeyChar < Convert.ToChar(48) Or e.KeyChar > Convert.ToChar(57) Then e.KeyChar = Convert.ToChar(0)
    End SubStart Free Trial
[+][-]12.17.2007 at 01:27AM PST, ID: 20483650

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.17.2007 at 01:30AM PST, ID: 20483661

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Visual Basic.Net, Visual Studio .NET 2005
Tags: vb, 2005, backspace, keypress
Sign Up Now!
Solution Provided By: Dhaest
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628