110,538
社区成员
发帖
与我相关
我的任务
分享
class mypanel : Panel
{
//添加键盘响应事件
private void ImputClass_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode== Keys.Delete)
{
if (this.Parent != null)
{
this.Parent.Controls.Remove(this);
this.Dispose();
}
}
}
}