Avatar of systems_ax
systems_ax

asked on 

key down event of text box in vb.net 2005

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

Open in new window

.NET ProgrammingVisual Basic ClassicVisual Basic.NET

Avatar of undefined
Last Comment
Jorge Paulino

8/22/2022 - Mon