Salve a tutti, sul web ho trovato questo codice che blocca lo spostamento del form:

codice:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

        Const WM_NCLBUTTONDOWN As Integer = 161
        Const WM_SYSCOMMAND As Integer = 274
        Const HTCAPTION As Integer = 2
        Const SC_MOVE As Integer = 61456
        If (m.Msg = WM_SYSCOMMAND) AndAlso _
              (m.WParam.ToInt32() = SC_MOVE) Then
            Return
        End If
        If (m.Msg = WM_NCLBUTTONDOWN) AndAlso _
              (m.WParam.ToInt32() = HTCAPTION) Then
            Return
        End If
        MyBase.WndProc(m)

    End Sub
Ma io vorrei che lo spostamento del form venga bloccato solo se il form è massimizzato! Come faccio? Qualcuno mi può aiutare? Grazie in anticipo!