این کد اصلاح شده برای خواسته شما عزیز جان
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const WS_SYSMENU = &H80000
Private Const WS_CAPTION = &HC00000
Private Const WS_THICKFRAME = &H40000
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const WS_BORDER = &H800000
Public Sub EnableResizing(Form As Form, Enable As Boolean)
Dim style As Long
style = GetWindowLong(Form.hwnd, GWL_STYLE)
If Enable Then
style = style Or WS_THICKFRAME
Else
style = style And Not WS_THICKFRAME
End If
style = SetWindowLong(Form.hwnd, GWL_STYLE, style)
End Sub
Private Sub MDIForm_Load()
Show
EnableResizing Me, False
Dim lStyle As Long
lStyle = GetWindowLong(MDIForm1.hwnd, GWL_STYLE) 'Get's the WindowLong
lStyle = lStyle And Not WS_BORDER
' lStyle = lStyle And Not WS_BORDER
' lStyle = lStyle And Not WS_CAPTION
' lStyle = lStyle And WS_BORDER And Not WS_CAPTION
Call SetWindowLong(MDIForm1.hwnd, GWL_STYLE, lStyle)
End Sub