问题 单项选择题

要求当鼠标在图片框Pl中移动时,立即在图片框中显示鼠标的位置坐标。下面能正确实现上述功能的事件过程是______。

A) Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)

P1.Print X,Y
End Sub
B) Private Sub P1_MouseMove(Button As Integer,Sluft As Integer,X As Single,Y As Single)

P1.PrintX,Y
End Sub
C) Private Sub P1_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)

Print X,Y
End Sub
D) Private Sub P1_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)

Picture,Print X.Y
End Sub

答案

参考答案:B

解析: 题目要求鼠标在图片框中移动,所以触发的是图片框的MouseMove事件,选项A) 中写的是窗体的MouseMove事件,所以是错误的;题目要求在图片框中显示鼠标移动的位置,选项C) 是在窗体中显示,所以是错误的;鼠标移动时触发的是MouseMove事件,所以选项D) 是错误的;只有选项B) 是正确的。

问答题 简答题
单项选择题