473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Windows Mobile KeyDown method error for navigation keys C#

15
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:

Expand|Select|Wrap|Line Numbers
  1. private void UnbrandedUI_KeyDown(object sender, KeyEventArgs e)
  2.         {
  3.             if ((e.KeyCode == System.Windows.Forms.Keys.Up))
  4.             {
  5.                 // Up 
  6.             }
  7.             if ((e.KeyCode == System.Windows.Forms.Keys.Down))
  8.             {
  9.                 for (int i = 0; i < this.Controls.Count; i++)
  10.                 {
  11.                     if (this.Controls[i].Focused)
  12.                     {
  13.                         this.SelectNextControl(this.Controls[i], true, true, true, true);
  14.                         break;
  15.                     }
  16.                 }
  17.             }
  18.             if ((e.KeyCode == System.Windows.Forms.Keys.Left))
  19.             {
  20.                 // Left 
  21.             }
  22.             if ((e.KeyCode == System.Windows.Forms.Keys.Right))
  23.             {
  24.                 // Right 
  25.             }
  26.             if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
  27.             {
  28.                 // Enter 
  29.             }
  30.         }
  31.  
Apr 7 '10 #1
2 2631
markmcgookin
648 Expert 512MB
So what exactly do you want?
Apr 8 '10 #2
gopishk
15
I have 1 screen which is having ImageButtons(Options, 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.
Apr 8 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Frans Bouma | last post by:
Hello, It seems VS.NET 2003 locks up itself and the complete shell (mouse locks also) when entering a breakpoint in a special situation. Below is the code to reproduce this behavior. It...
3
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I...
7
by: Nikki | last post by:
Hi, Can anybody help me, i want to prevent windows to close my winform of ..NET application, when user presses Alt+F4
2
by: ZS | last post by:
Hi, On a form , I'm trying to trap when a shift key is pressed. Can someone explain how the KeyUp,KeyDown and Key Press event works for Forms. Thanks -ZS
5
by: Lars Netzel | last post by:
Hey! I have tried...(in a datagrid) e.KeyDate.Return and e.KeyDate.TAB end e.KeyDate.Enter
2
by: Phil Galey | last post by:
I have a Panel control docked on all sides on a form and the panel control contains a PictureBox. I'm using the KeyDown event of the form to respond to the and keys for resizing the image and the...
0
by: tony | last post by:
Hello!! I have a derived class called StringClassEditor which inherit from UITypeEditor listed below. Now to my question in method EditValue in this class I have this statement lb.KeyDown ...
0
by: dtrudell75 | last post by:
Hi there, I'm running Visual Basic .Net 2003 and developing a windows mobile 2003 application. I'm using the following code to create and dispose of forms, but I'm running into a Stack...
3
by: Luc The Perverse | last post by:
Hey - I am making my first C# form application! (More a teach myself app than any pratical application) I have a listbox that always has the control so I made an event handler for KeyDown. I...
1
by: kgerritsen | last post by:
I am building an application that will receive input from a barcode scanner. The barcode scanner is configured to append to the front value a single character and hyphen that identify the barcode...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.