Public Sub EpsAdj(ByVal adjN)
Dim w1, h1, dx, dy As Double
'上方,垂直調整
If adjN = 0 Then
'計算垂直移動量
dy = CurPos.Y - Atp
If Math.Abs(dy) < h1 =" Math.Abs(Ahh"> Ahh Then
h1 = Math.Abs(Ahh + dy)
End If
If h1 > 0.0 Then
Canvas_Draw.Children(SelNo).SetValue(Canvas.LeftProperty, Alf)
Canvas_Draw.Children(SelNo).SetValue(Canvas.TopProperty, CurPos.Y)
Canvas_Draw.Children(SelNo).SetValue(Ellipse.WidthProperty, Aww)
Canvas_Draw.Children(SelNo).SetValue(Ellipse.HeightProperty, h1)
End If
ElseIf adjN = 1 Then
'計算垂直移動量
dx = CurPos.X - OldPos.X
If Math.Abs(dy) < w1 =" Math.Abs(Aww"> Aww Then
w1 = Math.Abs(Aww + dx)
End If
If w1 > 0.0 Then
Canvas_Draw.Children(SelNo).SetValue(Canvas.LeftProperty, Alf)
Canvas_Draw.Children(SelNo).SetValue(Canvas.TopProperty, Atp)
Canvas_Draw.Children(SelNo).SetValue(Ellipse.WidthProperty, w1)
Canvas_Draw.Children(SelNo).SetValue(Ellipse.HeightProperty, Ahh)
End If
ElseIf adjN = 2 Then
'計算垂直移動量
dy = CurPos.Y - OldPos.Y
If Math.Abs(dy) < h1 =" Math.Abs(Ahh"> Ahh Then
h1 = Math.Abs(Ahh - dy)
End If
End Sub
沒有留言:
張貼留言