0 votes
990 views
by (1.5k points)
I want to make ComboBox accept the only numeric value, not alpha characters and symbols.

1 Answer

0 votes
by (10.3k points)

Just trigger the below code at ComboBox KeyPress Event.

Dim KeyAscii As Integer = Asc(e.KeyChar)
        Select Case KeyAscii
            Case 8, 27, 48 To 57, 9
            Case Else
                KeyAscii = 0
        End Select

        If KeyAscii = 0 Then
            e.Handled = True
        Else
            e.Handled = False
        End If
...