日期:2014-05-17 浏览次数:21124 次
public Form1()
{
InitializeComponent();
Button btn = new Button() { Width = 100, Height = 100 };
this.Controls.Add(btn);
btn.KeyUp += new KeyEventHandler(btn_KeyUp);
}
void btn_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.ShiftKey
------解决方案--------------------
e.KeyCode == Keys.ControlKey
------解决方案--------------------
e.KeyCode == Keys.Menu)
{
MessageBox.Show(e.KeyCode.ToString());
}
}