Private Const WM_MOVING As Int32 = &H216
Private Const [TRUE] As Int32 = 1
Private Structure RECT
Public Left As Int32
Public Top As Int32
Public Right As Int32
Public Bottom As Int32
Public Sub New(ByVal r As Rectangle)
Me.Left = r.Left
Me.Top = r.Top
Me.Right = r.Right
Me.Bottom = r.Bottom
End Sub
End Structure
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_MOVING Then
Runtime.InteropServices.Marshal.StructureToPtr(New RECT(Me.Bounds), m.LParam, False)
m.Result = New IntPtr([TRUE])
End If
MyBase.WndProc(m)
End Sub