D-Pad Navigation Sample (?)

Discussion in 'Questions (Windows Mobile)' started by Dave Mitchell, May 14, 2008.

  1. Dave Mitchell

    Dave Mitchell Member Licensed User

    I have been trying to include D-Pad navigation in one of my projects and thanks to help from this group have made some progress. I thought I would post the finished example, but ran into a snag. I can use the D-Pad to cycle through several controls on a form, but am unable to use the center button (enter) to select the control. Ideally, when the center button was pressed, it would release control to the current control so further manipulation was possible. Is there a way to pass the center button so it isn't captured? Here is the sample.
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    You shouldn't use HardKey here.
    First set the form's KeyPreview property to true (with the Door library).
    This is an example of navigating between two textboxes:
    oFrm is an Object.
    Code:
    Sub Globals
        current = 
    1
    End Sub

    Sub App_Start
        Form1.Show
        ofrm.New1(
    false)
        ofrm.FromControl(
    "Form1")
        ofrm.SetProperty(
    "KeyPreview",true)
    End Sub


    Sub Form1_KeyPress (specialKey)
        
    If specialKey = cUpKey OR specialKey = cDownKey Then
            current = 
    1 + (current Mod 2)
            
    Control("TextBox" & current).Focus
        
    End If
    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice