473,657 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Mobile KeyDown method error for navigation keys C#

15 New Member
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 2637
markmcgookin
648 Recognized Expert Contributor
So what exactly do you want?
Apr 8 '10 #2
gopishk
15 New Member
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.
Apr 8 '10 #3

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

Similar topics

0
2406
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 contains a line where you have to set a breakpoint (the first line in the validation event handler). Compile and run in the debugger in vs.net using F5. When you hit 'enter' in the textbox, the debugger should break in the validator routine where you...
3
9218
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 click on a row (withs will turn blue then) and then click on it again . Now if I press any key the event will fire (except for the arrow keys). I also tried to override the IsInputKey => no luck. I also tried to override the ProcessCmdKey => With...
7
7883
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
4092
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
2891
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
4161
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 PageUp, PageDn, Home, End, and arrow keys for scrolling the Panel control. Resizing the image using the and keys works fine, deriving a resized thumbnail from the image and reassigning it to the Image property of the PictureBox. However I'm...
0
1751
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 += new KeyEventHandler(ListBox_KeyDown); I have set a breakpoint in the event handler method ListBox_KeyDown but this method is never called. So this event KeyDown for control ListBox is never occuring.
0
1417
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 Overflow error because of the method I'm using. Dim frmM As frmMenu frmM = New frmMenu
3
7885
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 seem to be losing information when Casting to char, since I never have any problem using special keys if I use something like e.KeyCode == Keys.Delete But . . there is no Keys.Astericks (or Star or similar)
1
4753
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 standard, then the value in the barcode, terminated by a return. The barcode scanner appears to the operating system as a USB keyboard. I am loading the barcode value into a textbox both on my Form1 and on a dialog box where the user has to...
0
8394
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.