在窗体上画一个文本框,然后编写VB程序,程序运行后,如果按下键盘上的A,B,C,D键则在文本框中显示EFGH
发布网友
发布时间:2022-04-19 11:59
我来回答
共1个回答
热心网友
时间:2023-10-24 16:37
Private Sub Form_Load()
Text1.Text = ""
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyA
Text1.Text = "E"
Case vbKeyB
Text1.Text = ""
Text1.Text = "F"
Case vbKeyC
Text1.Text = "G"
Case vbKeyD
Text1.Text = "H"
Case Else
MsgBox "对不起只能输入A、B、C、D"
End Select
End Sub