Shortcut: alt+leftarrow?

  • Thread starter Thread starter Torben Philippsen
  • Start date Start date
T

Torben Philippsen

Hello!

In my MDI application it would be nice if one could navigate the collection
of mdi childs using eg. alt+leftarrow and alt+rightarrow.

The build in shortcuts doesn't support the use of the arrow keys at all. Is
it possible to create my own shortcuts?

Thank you
Torben
 
Here is how we're doing it

Implement IMessageFilter like this:

Public Const WM_KEYDOWN As Integer = &H100
Public Const WM_SYSKEYDOWN As Integer = &H104

Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As
Boolean _
Implements System.Windows.Forms.IMessageFilter.PreFilterMessage
If m.Msg = WM_KEYDOWN OrElse m.Msg = WM_SYSKEYDOWN Then
Dim keyData As Keys = CType(m.WParam.ToInt32, Keys) Or
Control.ModifierKeys
Dim ctrl As Control = Control.FromChildHandle(m.HWnd)
If keyData = (Keys.Alt Or Keys.Left) Then
' Move left
Return True
ElseIf keyData = (Keys.Alt Or Keys.Right) Then
' Move right
Return True
Else
Return False
End If
End If
End Function

/claes
 
Back
Top