作者:.NET开发
项目:System.Windows.Inpu
// A bitwise AND operation is used in the comparison.
// e is an instance of KeyEventArgs.
// btnDown is a Button.
if ((e.KeyStates & KeyStates.Down) > 0)
{
btnDown.Background = Brushes.Red;
}