没有直接的属性,只能用APIPrivate Const WS_MINIMIZEBOX = &H20000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const GWL_STYLE = (-16) Private Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Sub MDIForm_Load() Dim L as Long L = GetWindowLong(Me.hWnd, GWL_STYLE) L = L And Not (WS_MINIMIZEBOX) '最小化 L = L And Not (WS_MAXIMIZEBOX) '最大化 L = SetWindowLong(Me.hWnd, GWL_STYLE, L) End Sub
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16) Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Sub MDIForm_Load()
Dim L as Long L = GetWindowLong(Me.hWnd, GWL_STYLE)
L = L And Not (WS_MINIMIZEBOX) '最小化
L = L And Not (WS_MAXIMIZEBOX) '最大化
L = SetWindowLong(Me.hWnd, GWL_STYLE, L)
End Sub
L = L And Not (WS_SYSMENU ) '关闭