0
private void MoveThumb(Thumb thumb, Point position)
{
var element = AdornedElement as FrameworkElement;
position = new Point(position.X * element.ActualWidth, position.Y * element.ActualHeight);
**var halfSize = (Vector)thumb.DesiredSize/2;**
thumb.Arrange(new Rect(position - halfSize, position + halfSize));
}
這是VB.net我能轉換:需要的VB相當於
Private Sub MoveThumb(ByVal thumb As Thumb, ByVal position As Point)
Dim element = TryCast(AdornedElement, FrameworkElement)
position = New Point(position.X * element.ActualWidth, position.Y * element.ActualHeight)
Dim halfSize As Object = DirectCast(thumb.DesiredSize, Vector)/2
thumb.Arrange(New Rect(position - halfSize, position + halfSize))
End Sub
跟它不能轉換window.size到window.vector
誰能幫助我有了這個。
謝謝,
你確定你知道Vector Class/Struct的初始值設定項嗎?你給的初始化方法可能對Vector類/結構體是錯誤的。 – 2010-08-18 08:42:05
我會檢查一下謝謝。 – spafa9 2010-08-18 20:01:35