单选题
要求当鼠标在图片框P1中移动时,立即在图片框中显示鼠标的位置坐标。下列能正确实现上述功能的事件过程是
A、
Private Sub P1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Print X,Y
End Sub
B、
Private Sub P1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture.Print X,Y
End Sub
C、
Private Sub P1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
P1.Print X,Y
End Sub
D、
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
P1.Print X,Y
End Sub
【正确答案】
C
【答案解析】
[解析] 当鼠标在图片框中移动时,引发的事件是图片框P1的MouseMove事件。选项B的事件不正确,选项D的对象不正确。由于题目要求在图片框P1上输出,所以应该为P1.Print x,y,选项C为正确答案。选项A将把结果输出到窗体上。
提交答案
关闭