I have a group of radio buttons inside a groupbox and I don't want the user to be able to move the focus away from a button by using the arrow keys. I've tried the following keydown event, but it never gets fired:
Does anyone how to do this, if it's possible? thanksCode:Private Sub rbCode_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles rbCode.KeyDown ' If an arrow key is pressed, maintain focus on this radio button If e.KeyCode = Keys.Left Or e.KeyCode = Keys.Right Or e.KeyCode = Keys.Up Or e.KeyCode = Keys.Down Then e.SuppressKeyPress = True rbCode.Focus() End If End Sub




Reply With Quote