请问MDI父窗体可以禁止最大化吗?
MDI父窗体没有Maxbutton的属性,怎样才能使到MDI父窗体可以禁止最大化呢? 谢谢!
'MDI Form
Option Explicit
Private Sub MDIForm_Load() Dim hwndMenu As Long Dim c As Long hwndMenu = GetSystemMenu(Me.hwnd, 0) c = GetMenuItemCount(hwndMenu) DeleteMenu hwndMenu, c - 3, MF_BYPOSITION End Sub
Option Explicit
'in a module '///////////////////////////////////////////////////////////////////////////// '处理窗体形状及系统菜单所需常量及API声明 Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long Public Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long Public Const MF_BYPOSITION = &H400&
以上代码可以禁用最大化功能,不过界面上还会显示,只不过点了没反应