views:

15

answers:

1

Hi all,

I am haveing a windows application, developed using vb.net.Now I need to use the arrow keys to move the focus to the next controls like tabs. The controls are in groupboxes.

Is there any idea about how to approach this?

In a groupbox I have 3 columns of controls,now my focus is in second column second control. When I press left arrow,the focus needs to go to left control

then right arrow needs to go to straight right control.

Up and down keys should go to the respective controls.

If there is no controls present in anyof the sides then the focus should be present in the same control.

A: 

In VB.Net :

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As
    System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        Dim MyKey As System.Windows.Forms.Keys
        If e.KeyCode = Keys.Down Then
            MyKey = Keys.Tab
        ElseIf e.KeyCode = Keys.Tab Then
            MyKey = Keys.Tab
    End If
    MyBase.ProcessDialogKey(MyKey)
End Sub
dejavu
This code is not workign when i am using splitcontainer and groupboxes to hold the controls the in it.
Ramesh