Page 1 of 1

KeyUp Event

Posted: Thu Dec 14, 2006 7:14 pm
by 9642161
Should the Alt Key raise a KeyUp event? In an application that I am working on I need to trap the event for when the Alt key is released.

Thanks

Posted: Wed Dec 20, 2006 1:06 pm
by narcis
Hi histry,

As told in this MSDN's page you can do something like this:

Code: Select all

    private void tChart1_KeyUp(object sender, KeyEventArgs e)
    {
      MessageBox.Show(e.Alt.ToString());
    }
And then do a Alt+C (or whatever).

With Alt key alone you can use:

Code: Select all

    private void tChart1_KeyUp(object sender, KeyEventArgs e)
    {
      MessageBox.Show(e.KeyValue.ToString());
    }