The code below captures a 'Ctrl-A' KeyDown event. Yesterday it worked fine. I've made no changes to it, yet today, it no longer works. The KeyDown event fires, but whereas yesterday, 65 (for 'a') was written to output, now it writes 17 for the control key, even though I'm pressing Ctrl+A. I thought it had something to do with accidentally changing something in the designer details for the form via Find and Replace (not sure how I managed to do that). However, I've rebuilt the form from scratch and it still doesn't work.

Private Sub ListView_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListView.KeyDown

If e.Control Then
Console.WriteLine(e.KeyCode)
If e.KeyCode = Keys.A Then
For i As Integer = 1 To ListView.Items.Count
ListView.Items(i - 1).Selected = True
Next
End If
End If

End Sub


Can anybody suggest anything? Thanks in advance.