(22) 在窗體上畫一個名稱為Text1的文本框,要求文本框只能接收大寫字母的輸入。以下能實現(xiàn)該操作的事件過程是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
正確答案: A
相關(guān)推薦:
在VB中利用遠程數(shù)據(jù)庫的訪問之應(yīng)用舉例 VB中利用遠程數(shù)據(jù)庫的訪問之?dāng)?shù)據(jù)處理案例