M
mart_nl
Dear group,
I am trying to move a panel (panel2) around which is inside another
panel (panel1). I want the user to be able to use the arrow keys on the
keyboard.
However when I press either arrow key, focus is set to my toolbar
(toolbar1) and you see focus going from pushbutton to pushbutton.
I've tried keydown events on mybase, panel1, panel2 and finally only
this is working:
Private Sub ToolBar1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ToolBar1.KeyDown
If e.KeyCode = Keys.Right Then
panel2.location = [etc]
End If
End Sub
However this is not a nice workaround. If the user presses right or
left several times in a row or holds down the key, you see the panel
moving alright but also the toolbar gets repainted over and over again
to a point it can't repaint quickly enough and disappears a moment.
So both the panel is moving and the focus is moving over the
pushbuttons on the toolbar.
Can someone tell me how to tell the toolbar _not_ to catch keydown
events and let the panel1, panel2 or mybase or even the form handle
this (where it should be in this situation).
Help is appreciated!
Kind Regards,
Martin.
I am trying to move a panel (panel2) around which is inside another
panel (panel1). I want the user to be able to use the arrow keys on the
keyboard.
However when I press either arrow key, focus is set to my toolbar
(toolbar1) and you see focus going from pushbutton to pushbutton.
I've tried keydown events on mybase, panel1, panel2 and finally only
this is working:
Private Sub ToolBar1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ToolBar1.KeyDown
If e.KeyCode = Keys.Right Then
panel2.location = [etc]
End If
End Sub
However this is not a nice workaround. If the user presses right or
left several times in a row or holds down the key, you see the panel
moving alright but also the toolbar gets repainted over and over again
to a point it can't repaint quickly enough and disappears a moment.
So both the panel is moving and the focus is moving over the
pushbuttons on the toolbar.
Can someone tell me how to tell the toolbar _not_ to catch keydown
events and let the panel1, panel2 or mybase or even the form handle
this (where it should be in this situation).
Help is appreciated!
Kind Regards,
Martin.