Windows Mobile KeyDown method error for navigation keys C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gopishk
    New Member
    • Apr 2010
    • 15

    Windows Mobile KeyDown method error for navigation keys C#

    Hi,
    I have an HTC Ozone, which has no touch support. So have to implement KeyDown method to trace the navigation keys.
    In the screen i have image buttons, so when iam pressing any of the keys, its only selecting/opening the last image button contents.
    And also i cant see any highlighter moving on pressing the navigation keys.

    The KeyDown method i added is as follows:

    Code:
    private void UnbrandedUI_KeyDown(object sender, KeyEventArgs e)
            {
                if ((e.KeyCode == System.Windows.Forms.Keys.Up))
                {
                    // Up 
                }
                if ((e.KeyCode == System.Windows.Forms.Keys.Down))
                {
                    for (int i = 0; i < this.Controls.Count; i++)
                    {
                        if (this.Controls[i].Focused)
                        {
                            this.SelectNextControl(this.Controls[i], true, true, true, true);
                            break;
                        }
                    }
                }
                if ((e.KeyCode == System.Windows.Forms.Keys.Left))
                {
                    // Left 
                }
                if ((e.KeyCode == System.Windows.Forms.Keys.Right))
                {
                    // Right 
                }
                if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
                {
                    // Enter 
                }
            }
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    So what exactly do you want?

    Comment

    • gopishk
      New Member
      • Apr 2010
      • 15

      #3
      I have 1 screen which is having ImageButtons(Op tions, such as - Settings, Help and About), this is not a touch phone(HTC Ozone), so need to implement KeyDown method for this class.

      I had tried adding the KeyDown method for this class, but on pressing anykey, everytime it opens the last imagebutton's contents(the About screen). Iam not getting its behaviour. And do we need to add a highlighter for the imagebuttons as well or WinMo will take care of itself.

      Its like the 'left' , 'right' 'up' and 'down' keys to scroll through the image buttons and 'enter' to select the imagebutton to show new screen(new screens are already there), just navigation is required.

      So can you plz help me out with implementing KeyDown method in C# for the class.

      I hope iam more clear this time.

      Thanks.

      Comment

      Working...