回复 5楼 ZHRXJR
Private Sub Pic_Front_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) '''''''''''显示鼠标所在点的坐标值
Top = (ScalH - ClipH) / 2
Bottom = (ScalH + ClipH) / 2
Left = (ScalW - ClipW) / 2
Right = (ScalW + ClipW) / 2
Pic_Front.CurrentX = X
Pic_Front.CurrentY = Y
MouseX = (X - Left) / ClipW
MouseY = (Y - Top) / ClipH
If MouseX >= 0 And MouseX <= 1 And MouseY >= 0 And MouseY <= 1 Then
SBar1.Panels(1).Text = "坐标(" + Format(MouseX, "#####0.000") + " " + "," + " " + Format(MouseY, "#####0.000") + ")"
Else
SBar1.Panels(1).Text = ""
End If
End Sub
这个Picture鼠标触发事件的代码,没有窗体位置的代码,窗体的Startupposition值已设成2 ,但是运行时,只要鼠标经过Picture,窗体位置就会移动到桌面左上角。