单选题 VB
题号 #2536003

设在窗体上有一个文本框,然后编写如下的事件过程:
Private Sub Text1_KeyDown (KeyCode As Integer ,Shift As Integer)
Const Alt =4
Const Key_F2=&H71
altdown %=(Shift And Alt)>0
f2down %=(KeyCode =Key_F2)
If altdown %And f2down %Then
Text1.Text ="abl"
End If
End Sub
程序运行后,清除文本框中原有内容,如果按Shift +F2键,则在文本框中显示的是( )。

进入在线模考

参考答案

D

答案解析

本题在程序体中设置了altdown %和f2down %标志位,如果f2down %为True ,则表示按下了F2键,如果altdown %为True ,则表示按下了Alt 键,因此当程序运行是按下Shift +F2时并不会有任何事件发生。

你可能感兴趣的试题

A.Int(Rnd*21+30)
B.Int(Rnd*20+30)
C.Int(Rnd*50-Rnd*30)
D.Int(RND*30+50)
A.Private Sub Ti mer1_Ti mer()
Label1.Caption =True
End Sub
B.Private Sub Ti mer1_Ti mer()
Label1.Caption =Ti me$
End Sub
C.Private Sub Ti mer1_Ti mer()
Label1.Interval =1
End Sub
D.Private Sub Ti mer1_Ti mer()
For k =l To Ti mer1.Interval
Label1.Caption =Ti mer Next k
End Sub
找试题 · 找答案 · 找资料 在线模考