Check box focus problem on smartphone

  • Thread starter Thread starter dev15
  • Start date Start date
D

dev15

Hi, i have a simple VS2005 vb.net cf v1app with 4 checkbox controls
on a form. I want to use the joystick on the smartphone WM5 to navigate
between the controls. However when i try to change focus from the
Checkbox1 which seems to automatically have the focus when the
the form is loaded it doesn't move from it. If i hit the left key on the
joystick
i see that Checkbox 2 temporarily gets the focus as implemented in my
code below but after the event handler completes it return to Checkbox 1.
Can someone please point out what i am doing wrong.

Thanks

Private Sub CheckBox1_KeyDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles CheckBox1.KeyDown

Select Case e.KeyCode

Case Keys.Down

CheckBox3.Focus()

Case Keys.Up

CheckBox3.Focus()

Case Keys.Left

CheckBox2.Focus()

Case Keys.Right

CheckBox2.Focus()

Case Keys.Return

End Select

End Sub
 
you must handled the event, before you move the focus,
e.handled=true
try it

dev15 escribió:
 
Hi , i tried this but it doesn't work

Private Sub CheckBox1_KeyDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles CheckBox1.KeyDown

e.Handled = True

Select Case e.KeyCode

Case Keys.Down

CheckBox3.Focus()

Case Keys.Up

CheckBox3.Focus()

Case Keys.Left

CheckBox3.Focus()

Case Keys.Right

Case Keys.Return

'Do your thing for joystick press

End Select

End Sub
 
Back
Top