So I've been trying to make a form in which a few of the buttons have keyboard shortcuts such as the F keys as well as the arrow buttons. Here's the code I've been using
Private Sub frmOrganizer_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If obSelect = True Then
If e.KeyCode = Keys.F3 Then
If shortcut1 = False Then
shortcut1 = MakeShortcut(btnSC1)
Else
CategorizeFile(btnSC1.Text.Substring(0, btnSC1.Text.IndexOf(ControlChars.Quote) - 1))
End If
End If
Else : MessageBox.Show("Please select a category first.")
End If
It seems to me like this should work but it doesn't when I run the program. I think it might possibly be something with buttons being selected on the form. If this is so how would I go about fixing it?
Private Sub frmOrganizer_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If obSelect = True Then
If e.KeyCode = Keys.F3 Then
If shortcut1 = False Then
shortcut1 = MakeShortcut(btnSC1)
Else
CategorizeFile(btnSC1.Text.Substring(0, btnSC1.Text.IndexOf(ControlChars.Quote) - 1))
End If
End If
Else : MessageBox.Show("Please select a category first.")
End If
It seems to me like this should work but it doesn't when I run the program. I think it might possibly be something with buttons being selected on the form. If this is so how would I go about fixing it?