Sembra funzionare abbastanza bene.
il cuore di tutto è
Public Sub New()
InitializeComponent()
Me.SetStyle(ControlStyles.ResizeRedraw, True) ' this is to avoid visual artifacts
End Sub
Private Const cGrip As Integer = 1 '16
Private Const cCaption As Integer = 62
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = &H84 Then
Dim pos As Point = New Point(m.LParam.ToInt32())
pos = Me.PointToClient(pos)
If pos.Y < cCaption Then
m.Result = CType(2, IntPtr)
Return
End If
If pos.X >= Me.ClientSize.Width - cGrip AndAlso pos.Y >= Me.ClientSize.Height - cGrip Then
m.Result = CType(17, IntPtr)
Return
End If
End If
MyBase.WndProc(m)
End Sub