'点击某一点时,显示其坐标
Private Sub PIC_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim strg As String
Static x0 As Single
Static y0 As Single
Static button0 As Integer
If button0 = 2 And Button = 2 Then
ElseIf Button = 1 Then
strg = InputBox("输入标注文字:(当前坐标(" & Fix(X) + CInt((X - Fix(X)) * 1000) / 1000 & "," & Fix(Y) + CInt((Y - Fix(Y)) * 1000) / 1000 & "))")
PIC.CurrentX = X: PIC.CurrentY = Y: PIC.Print strg
End If
x0 = X
y0 = Y
button0 = Button
End Sub请问各位,我想在图上实现输入标注文字后,可以移动其位置,以达到最佳效果,该如何实现?
Private Sub PIC_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim strg As String
Static x0 As Single
Static y0 As Single
Static button0 As Integer
If button0 = 2 And Button = 2 Then
ElseIf Button = 1 Then
strg = InputBox("输入标注文字:(当前坐标(" & Fix(X) + CInt((X - Fix(X)) * 1000) / 1000 & "," & Fix(Y) + CInt((Y - Fix(Y)) * 1000) / 1000 & "))")
PIC.CurrentX = X: PIC.CurrentY = Y: PIC.Print strg
End If
x0 = X
y0 = Y
button0 = Button
End Sub请问各位,我想在图上实现输入标注文字后,可以移动其位置,以达到最佳效果,该如何实现?
他们的拖动你可以在mousedown事件里来写,最原始的方法就是判断鼠标移动的相对位置然后改变lable或textbox的位置属性。
对于textbox还有更为巧妙的方法,你需要也可以给你。
.move属性吧
lable.move left,top,width,height
其中的left,top,width,height用变量
将它写到一个过程或函数里面,在调用即可