窗体上已有1个名称为Picture1的图片框,要求实现下面2个功能之一: (1)在窗体上移动鼠标时,立即将Picture1显示在鼠标位置 (2)在窗体上单击鼠标时,立即将Picture1显示在鼠标位置 下面不能实现上述任何功能的事件过程是

admin2019-03-14  26

问题 窗体上已有1个名称为Picture1的图片框,要求实现下面2个功能之一:
(1)在窗体上移动鼠标时,立即将Picture1显示在鼠标位置
(2)在窗体上单击鼠标时,立即将Picture1显示在鼠标位置
下面不能实现上述任何功能的事件过程是

选项 A、Private Sub Form_MouseDown(Button As Integer, Shift As Integer,
                           X As Single, Y As Single)
   Picture1.Move X, Y
End Sub
B、Private Sub Form_MouseUp(Button As Integer, Shift As Integer,
                         X As Single, Y As Single)
   Picture1.Move X, Y
End Sub
C、 Private Sub Form_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
   Picture1.CurrentX = X
   Picture1.CurrentY = Y
End Sub
D、Private Sub Form_MouseMove(Button As Integer, Shift As Integer,
                           X As Single, Y As Single)
   Picture1.Move X, Y
End Sub

答案C

解析 Picture的CurrentX和CurrentY属性,是将光标定位在 x与y 的位置,并没有把Picture显示在鼠标位置,所以选C)。
转载请注明原文地址:https://kaotiyun.com/show/xKFp777K
0

最新回复(0)