单选题
VF
题号 #490066
有一个名称为Forml的窗体,上面没有控件,设有以下程序(其中方法PSet(X,Y) 的功能是在坐标x,Y处画一个点):
Dim cmdmave As Boolean
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
Cmdmave=True
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If cmdmave Then
Form l.PSet(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
Cmdmave=False
End Sub
此程序的功能是( )
参考答案
D
答案解析
程序定义了一个模块变量cmdmave,当按下鼠标按键时,其值为True,当松开鼠标按键时,其值为False。当按下鼠标按键并在窗体拖动鼠标时,PSet方法在鼠标经过的位置画点,所有的点连起来就形成一条线,当松开鼠标按键时,cmdmave为False,结束画点。所以,答案是D。
你可能感兴趣的试题
A.单击鼠标
B.双击文本框
C.鼠标滑过文本框
D.按下键盘上的某个键


( )