我得到了這一塊的畫布上走動的元素vb.net不能刪除處理
Private p As Point
Private Sub moveHandler() Handles Me.MouseDown
p = Mouse.GetPosition(Me)
AddHandler canvasRef.MouseMove, AddressOf moveLoop
End Sub
Private Sub moveLoop()
If Mouse.LeftButton = MouseButtonState.Pressed Then
Dim c As Point = Mouse.GetPosition(canvasRef)
Canvas.SetLeft(Me, c.X - p.X)
Canvas.SetTop(Me, c.Y - p.Y)
Else
RemoveHandler canvasRef.MouseMove, AddressOf moveLoop
End If
End Sub
它強調了removehandler並說像「的addressof表達沒有任何影響,因爲它需要一個寬鬆取而代之的是一些東西,讓代表和刪除!「
對我沒有意義。