问题
单项选择题
在窗体上画一个名称为Text1的文本框,要求文本框只能接收大写字母的输入。以下能够正确实现该操作的事件过程是______ 。
A.Private Sub Text1_ KeyPress (KeyAscii As IntegeIfKeyAscii < 65 Or KeyAscii > 9t Then MsgBox “请输入大写字母”End If End sub
B.Private Sub Text1_ KeyDown (KeyCode As Integer, Shift As IntegeIfKeyCode < 65 Or KeyCode > 91 Then MsgBox “请输入大写字母”End If End sub
C.Private Sub Text1_ MouseDown (Button As Integer, _ Shift As Integer, X As Single, YAs SinglIfAsc (Text1.Tex < 65 Or Asc (Text1. Tex > 91 Then MsgBox “请输入大写字母”End If End sub
D.Private Sub Text1_ Change()IfAsc(Text 1.Tex < 65 Or Asc(Text1. Tex > 91 Then MsgBox “请输入大写字母”End If End sub
答案
参考答案:A