我希望利用vb程序在Picture1中单击鼠标,text1和text2就显示自定义坐标系的值
PrivateSubPicture1_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)Pictu...
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Scale (-20, 20)-(30, -20)
Text1.Text = X / Screen.TwipsPerPixelX
Text2.Text = Y / Screen.TwipsPerPixelY
End Sub 展开
Picture1.Scale (-20, 20)-(30, -20)
Text1.Text = X / Screen.TwipsPerPixelX
Text2.Text = Y / Screen.TwipsPerPixelY
End Sub 展开
1个回答
展开全部
Private Sub Form_Load()
Picture1.Scale (-20, 20)-(30, -20)
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = Format(X, "0")
Text2.Text = Format(Y, "0")
End Sub
Picture1.Scale (-20, 20)-(30, -20)
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = Format(X, "0")
Text2.Text = Format(Y, "0")
End Sub
追问
谢谢!
再追问一个问题
如何实现:随鼠标移动实时显示Picture1自定义坐标系的值,自定义坐标系的值就显示在鼠标下方。
追答
Private Sub Picture1_Mousemove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.ToolTipText=format(X, "0") & "," & Format(Y, "0")
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询