troubleshooting Question

key down event of text box in vb.net 2005

Avatar of systems_ax
systems_ax asked on
.NET ProgrammingVisual Basic ClassicVisual Basic.NET
16 Comments1 Solution768 ViewsLast Modified:
I am developing with visual basic 2005.
I am attempting to validate 1 of the text boxes on my form so that specila characters are not allowed to be entered first.  They can be entered but they cannot be inputted as the first entry into the text bix.
this is  my current validation, which does not work I also tried setting e.shift to true and false all without success.
thank you

Private Sub txtID_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtID.KeyDown
        If e.Shift And Me.txtID.Text.Length = 0 Then
            e.SuppressKeyPress = True
            Exit Sub
        End If
     End Sub
ASKER CERTIFIED SOLUTION
Jorge Paulino
IT Pro/Developer
Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros