二级二级VB2004年4月全国计算机等级考试二级VB语言笔试试题
题目内容

在窗体上画一个名称为Text1的文本框,要求文本框只能接收大写字母的输入。以下能实现该操作的事件过程是

2024-07-09

A.Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii < 65 Or KeyAscii > 90 ThenMsgBox "请输入大写字母"KeyAscii = 0End IfEnd Sub

B.Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode < 65 Or KeyCode > 90 ThenMsgBox "请输入大写字母"KeyCode = 0End IfEnd Sub

C.Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)If Asc(Text1.Text) < 65 Or Asc(Text1.Text) > 90 ThenMsgBox "请输入大写字母"End IfEnd Sub

D.Private Sub Text1_Change()If Asc(Text1.Text) > 64 And Asc(Text1.Text) < 91 ThenMsgBox "请输入大写字母"End IfEnd Sub

题目答案

试卷相关题目

最新试卷
热门试卷

长理培训客户端 资讯,试题,视频一手掌握

去 App Store 免费下载 iOS 客户端