把窗体的keypreview属性设true,keydown事件代码:If keycode = vbKeyEscape Then Command1_ClickCommand1_Click 代码:Text1.Text = "Visual Basic"