定义按钮txtAPrivate Sub txtA_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 13 Then txtA.Text = txtA.Text + "A" End IfEnd Sub