Private Sub showW_Click()
With uf2
Dim L1#, T1#, OperX&, OperY&
If Not .Visible Then
ddecx = 0: ddecy = 0 '1er lancement
.StartUpPosition = 0
With ActiveWindow
PtoPx = (.ActivePane.PointsToScreenPixelsY(72) - .ActivePane.PointsToScreenPixelsY(0)) / 72 'coeff point to pixel
Z = .Zoom / 100
L1 = (.ActivePane.PointsToScreenPixelsX(Int([b3].Left)) / PtoPx) * Z 'placement partie mobile
T1 = .ActivePane.PointsToScreenPixelsY(Int([b3].Top)) / PtoPx * Z
End With
.Left = L1
.Top = T1
.Show 0
ddecx = L1
ddecy...
Si je comprend bien, les textbox doivent avoir la différence entre les deux dernières positions ?re
bonjour @fanch55
ben non puisque les textbox reçoivent la nouvelle position hors c'est la différence entre la première position et la 2d qui devrait atterrir dans les textboxs
je dirais même pire il additionne au lieu de soustraire selon le cas
si j'ai mon uf2 a 123 de left et que le repositionne à 128 de left je devrait avoir dans ddecx 5
si j'ai mon uf2 a 128 de left et que le repositionne à 123 de left je devrait avoir dans ddecx -5
hors dans les deux sens il additionne j'obtiens 133
Je t'avoue que je ne comprend pas pourquoi tu remets les variables à Zéro ?Si je comprend bien, les textbox doivent avoir la différence entre les deux dernières positions ?
ok, mais elles sont remises à zéro à chaque fois avant de faire les calculs ?re
c'est pas des variables c'est les textboxs
Private Sub showW_Click()
With uf2
Dim L1#, T1#
If Not .Visible Then
ddecx = 0: ddecy = 0 '1er lancement
.StartUpPosition = 0
With ActiveWindow
PtoPx = (.ActivePane.PointsToScreenPixelsY(72) - .ActivePane.PointsToScreenPixelsY(0)) / 72 'coeff point to pixel
Z = .Zoom / 100
L1 = (.ActivePane.PointsToScreenPixelsX(Int([b3].Left)) / PtoPx) * Z 'placement partie mobile
T1 = .ActivePane.PointsToScreenPixelsY(Int([b3].Top)) / PtoPx * Z
End With
.Left = L1
.Top = T1
.Show 0
ddecx = L1
ddecy = T1
Else
operx = Sgn(uf2.Left - CDbl(ddecx))
opery = Sgn(uf2.Top - CDbl(ddecy))
ddecy = (opery * uf2.Top) - CDbl(ddecy)
ddecx = (operx * uf2.Left) - CDbl(ddecx)
End If
End With
End Sub
Private Sub showW_Click()
With uf2
Dim L1#, T1#
If Not .Visible Then
ddecx = 0: ddecy = 0 '1er lancement
.StartUpPosition = 0
With ActiveWindow
PtoPx = (.ActivePane.PointsToScreenPixelsY(72) - .ActivePane.PointsToScreenPixelsY(0)) / 72 'coeff point to pixel
Z = .Zoom / 100
L1 = (.ActivePane.PointsToScreenPixelsX(Int([b3].Left)) / PtoPx) * Z 'placement partie mobile
T1 = .ActivePane.PointsToScreenPixelsY(Int([b3].Top)) / PtoPx * Z
End With
.Left = L1
.Top = T1
.Show 0
ddecx = L1
ddecy = T1
Else
'operx = Sgn(uf2.Left - CDbl(ddecx))
'opery = Sgn(uf2.Top - CDbl(ddecy))
'ddecy = uf2.Top + (opery * CDbl(ddecy))
'ddecx = uf2.Left + (operx * CDbl(ddecx))
If uf2.Left < CDbl(ddecx) Then operx = "-"
ddecx = operx & Abs(uf2.Left - CDbl(ddecx))
If uf2.Top < CDbl(ddecy) Then opery = "-"
ddecy = opery & Abs(uf2.Top - CDbl(ddecy))
End If
End With
End Sub
Private Sub showW_Click()
With uf2
Dim L1#, T1#, OperX&, OperY&
If Not .Visible Then
ddecx = 0: ddecy = 0 '1er lancement
.StartUpPosition = 0
With ActiveWindow
PtoPx = (.ActivePane.PointsToScreenPixelsY(72) - .ActivePane.PointsToScreenPixelsY(0)) / 72 'coeff point to pixel
Z = .Zoom / 100
L1 = (.ActivePane.PointsToScreenPixelsX(Int([b3].Left)) / PtoPx) * Z 'placement partie mobile
T1 = .ActivePane.PointsToScreenPixelsY(Int([b3].Top)) / PtoPx * Z
End With
.Left = L1
.Top = T1
.Show 0
ddecx = L1
ddecy = T1
Else
OperX = Sgn(uf2.Left - CDbl(ddecx)): ddecx = OperX * (Abs(uf2.Left - CDbl(ddecx)))
OperY = Sgn(uf2.Top - CDbl(ddecy)): ddecy = OperY * (Abs(uf2.Top - CDbl(ddecy)))
End If
End With
End Sub