Check box focus problem on smartphone

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
 
D

David caso

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

dev15 escribió:
 
D

dev15

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top