I am in the process of designing a scouting program.
I have the following code:
Private Sub teamnum_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles teamnum.KeyPress
Dim allowedChars As String = "0123456789"
If allowedChars.IndexOf(e.KeyChar) = -1 Then
' Invalid Character
e.Handled = True
End If
End Sub
But I would like to add the function of a backspace key.
The solution to this problem in DOS-mode Pascal was to read ASCII character 8. In C, you would use \b or \x08. See this table for a VB constant called “vbBack” that may work equivalently.
Ok I finally found it. After a day on Google, here’s the code:
Dim i As Integer
For i = 0 To Me.CheckedListBox1.CheckedIndices.Count - 1
Me.CheckedListBox1.SetItemChecked(Me.CheckedListBox1.CheckedIndices(0), False)
Next i