473,325 Members | 2,308 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,325 software developers and data experts.

compact framework form keydown event???

Hi All,
I am trying to get Form keydown event in compact framework 3.5 but event is not triggering.
I have just one form form1.
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Dim oBinarySave As New Binary_Serialization
  3.     Dim FlagFormKeyDown As Boolean = False
  4.     Dim uicounter1 As UInt16 = 0
  5.     Dim uicounter2 As UInt16 = 0
  6.  
  7.     Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyDown
  8.         If Not FlagFormKeyDown Then
  9.             FlagFormKeyDown = True
  10.             uicounter1 += 1
  11.             Label1.Text = uicounter1
  12.         End If
  13.  
  14.     End Sub
  15.  
  16.     Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Panel1.KeyUp
  17.         uicounter2 += 1
  18.         Label2.Text = uicounter2
  19.         FlagFormKeyDown = False
  20.     End Sub
  21. End Class
  22.  
whts problem...?
Jun 18 '09 #1
4 5627
Frinavale
9,735 Expert Mod 8TB
Are you sure it's not triggering?
Did you use the debugger to determine if the application steps into the method that handles the KeyDown Event?

It may be that you aren't refreshing the display and so the Label you're using to display the uicounter1 variable isn't updating.

-Frinny
Jun 18 '09 #2
Plater
7,872 Expert 4TB
If anything other then the form has the focus, it won't generate key up/down events.
Jun 18 '09 #3
Thanks,
for your guidance. the application is for wince. and i dont have win ce emulator installed on my system thats why i cannot go in debug mode.
Secondly form is selected and all keyboards events goes to form.
I have got solution. The solution is that there is a Key Preview property of forum that is set to false by default. if we turn it to true. then events will trigger and now triggering.
Jun 20 '09 #4
Plater
7,872 Expert 4TB
If your device has active sync, you can debug through that.
I always wondered about that property, sometimes it works for people, other times it doesn't.
Jun 22 '09 #5

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

Similar topics

2
by: leotricaspio | last post by:
there, I'm trying to capture the Function keys (F1-F4, basically) but it's kind of difficult compare to .NET Framework. I have tried KeyPress, KeyDown, etc, without success. I downloaded the...
5
by: Adam | last post by:
Hi, How do i listen for windows messages in c# on compact.net? I have a window containing an instantiation of the HTML viewer control, which is a child of the main form. As the compact...
3
by: Frank T. Clark | last post by:
How do I redirect or capture keydown events in a parent form from a child form? I have a main form which displays another informational form marked "SizableToolWindow". Form child = new...
1
by: Ori | last post by:
Hi Guys, Here is my problem, but maybe someone can help me with this. Background: 1. Using C#. 2. I'm having a form which the KeyPreview is on (and must stay like this) and I'm...
5
by: WilliamRLinden | last post by:
Hi world! we are pretty new to JavaScript and have been struggling for now 2 days on this problem ... We would appreciate mercy if anyone can give us some. Basically we are trying to simulate...
2
by: spamlaanbroek | last post by:
The .NET WebBrowser control in the Compact Framework 2.0 is a major headache. Once it takes the focus (e.g. by the user tapping on it) it keeps it and keyboard events are not passed to the form...
1
markmcgookin
by: markmcgookin | last post by:
hi Folks, Just posting this as a solution to be honest (hope this is the right place) I created a form for PPC 2003 using VB.Net compact Framework One of my forms is longer than the screen,...
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...
7
by: Sin Jeong-hun | last post by:
I have a dialog form which pops up from the main window using the ShowDialog() method. this dialog has no or button, and it has quite a lot of controls on it. Now, I want to close this dialog...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.