题目

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

A.Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii<65 Or KeyAscii>90 Then

MsgBox "请输入大写字母"

KeyAscii=0

End If

End Sub

B.Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode <65 Or KeyCode>90 Then

MsgBox "请输入大写字母"

KeyCode=0

End If

End 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 Then

MsgBox "请输入大写字母"

End If

End Sub

D.Private Sub Text1_Change()

If Asc(Text1.Text) >64 And Asc(Text1.Text) <91 Then

MsgBox "请输入大写字母"

End If

End Sub

相关标签: 大写字母  

提示:未搜索到的试题可在搜索页快速提交,您可在会员中心"提交的题"快速查看答案。
答案
查看答案
相关试题
在ASCII码表中,按照ASCII码值从小到大的排列顺序是(  )。
A.数字、英文大写字母、英文小写字母B.数字、英文小写字母、英文大写字母C.英文大写字母、英文小写字母、数字D.英文小写字母、英文大写字母、数字

已知大写字母P的ASCII码值为50H,则大写字母I的ASCII码值为____H.

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

A.Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii<65 Or KeyAscii>90 Then

MsgBox "请输入大写字母"

KeyAscii=0

End If

End Sub

B.Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode <65 Or KeyCode>90 Then

MsgBox "请输入大写字母"

KeyCode=0

End If

End 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 Then

MsgBox "请输入大写字母"

End If

End Sub

D.Private Sub Text1_Change()

If Asc(Text1.Text) >64 And Asc(Text1.Text) <91 Then

MsgBox "请输入大写字母"

End If

End Sub

编写程序,如果输入的是大写字母,则输出对应的小写字母;如果输入的是小写字母,则输出对应的大写字母;如果输入的是数字,原样输出;按回车结束。

编一个程序,输入一个字符,如果输入的字符是大写字母,则转换为小写字母;如果输入的字符是小写字母,则转换为大写字母,否则不转换。

联系我们 会员中心
返回顶部