Link to home
Start Free TrialLog in
Avatar of Pretzel_Jesus
Pretzel_Jesus

asked on

ProcessCmdKey Question C# (500pts)

I am trying to trap all keydown and keyup events on a windows form in c#. I used the following code which works PERFECT for keydown events, but doesn't seem to fire at all for keyup events:

if (msg.Msg == WM_KEYDOWN)
{
    this.Text = "Keydown";
}
else if (msg.Msg == WM_KEYUP)
{
    this.Text = "KeyUp";
}

And the keydown always fires fine, and the keyup never fires. I tried putting breakpoints in to verify and the keyup is simply never triggered. What am I doing wrong?
Avatar of Shahan Ayyub
Shahan Ayyub
Flag of Pakistan image

Could you plz post your more code ??? Kindly clearify which object is reffering by 'msg'.
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pretzel_Jesus
Pretzel_Jesus

ASKER

Received answer elsewhere. Let from site provided.