PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Custom control's KeyDown / KeyPress event not fired?

 
 
tamberg
Guest
Posts: n/a
 
      27th Jun 2006
Is it possible that a trivial (class MyControl: Control {}) custom
control's KeyDown / KeyPress events are not fired on .NET CF 1.1 for
PPC2003 / WM5? This seems strange as the events are fired on SP2003.

 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      27th Jun 2006
There's no such thing as .NET CF 1.1.

I think you'll have to show us the simplest code that demonstrates the
problem.

Paul T.

"tamberg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible that a trivial (class MyControl: Control {}) custom
> control's KeyDown / KeyPress events are not fired on .NET CF 1.1 for
> PPC2003 / WM5? This seems strange as the events are fired on SP2003.
>



 
Reply With Quote
 
tamberg
Guest
Posts: n/a
 
      28th Jun 2006
Sorry, I meant .NET CF 1.0. Here's an example:

using System;
using System.Drawing;
using System.Windows.Forms;

class MyControl: Control {}

class KeyTest {

static Label log;

static void Log (string msg) { log.Text += msg; }
static void KeyDown (object o, KeyEventArgs a) { Log("Down "); }
static void KeyPress (object o, KeyPressEventArgs a) { Log("Press
"); }
static void KeyUp (object o, KeyEventArgs a) { Log("Up\n"); }

static void Main () {
Form f = new Form();
f.Text = "KeyTest";
MyControl mc = new MyControl();
mc.Bounds = new Rectangle(0, 0, f.ClientSize.Width, 7);
mc.KeyDown += new KeyEventHandler(KeyDown);
mc.KeyPress += new KeyPressEventHandler(KeyPress);
mc.KeyUp += new KeyEventHandler(KeyUp);
f.Controls.Add(mc);
log = new Label();
log.Bounds = new Rectangle(0, mc.Height, f.ClientSize.Width,
f.ClientSize.Height - mc.Height);
f.Controls.Add(log);
Application.Run(f);
}

}

..NET CF 1.0 compiling and running it on a PC / PPC2003 / WM5 leads to
this:

one of the arrow keys => "Up"
alphabetical key => "Down Press Up"
alphabetical key hold => "Down Press Down Press ... Down Press Up"

while running it on a Smartphone 2003 leads to:

one of the arrow keys => "Down Up"

Any ideas?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom event from a custom web control is fired twice SammyBar Microsoft ASP .NET 1 21st Jul 2009 09:16 PM
activex control custom event fired in IE7 but not IE6 Sue Windows XP Internet Explorer 1 5th Dec 2008 09:54 PM
Event fired twice with custom control Daniel Microsoft ASP .NET 0 4th Mar 2007 06:51 AM
KeyDown event is not fired =?Utf-8?B?TWljaGFlbA==?= Microsoft Dot NET Framework Forms 2 23rd Mar 2004 01:01 AM
Handke keypress - keydown event Label Control Peter Verburgh Microsoft C# .NET 3 10th Nov 2003 06:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:16 PM.