Torna al Thread
Public Class FormBloccabile
Inherits System.Windows.Forms.Form
' Zona dichiarazioni per immobilità del form
Const WM_NCLBUTTONDOWN As Int32 = &HA1
Const WM_SYSCOMMAND As Int32 = &H112
Const HTCAPTION As Int32 = &H2
Const SC_MOVE As Int32 = &HF010
Private FlagMobile As Boolean = True
'zona dichiarazioni x togliere la 'x' di chiusura
Private Declare Function RemoveMenu Lib "user32" Alias "RemoveMenu" (ByVal hMenu As IntPtr, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
Private Declare Function GetSystemMenu Lib "user32" Alias "GetSystemMenu" (ByVal hwnd As IntPtr, ByVal bRevert As Integer) As IntPtr
Private Const SC_CLOSE As Integer = &HF060&
Private Const MF_BYCOMMAND As Integer = &H0&
Private FlagConX As Boolean = True
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'RemoveMenu(GetSystemMenu(Me.Handle, False), SC_CLOSE, MF_BYCOMMAND)
End Sub