Hi List!
Do you know how can I prevent a MDI form from maximize?
They don“t have a Max-Button property. I think there may be an API call or something.
Thanks
Printable View
Hi List!
Do you know how can I prevent a MDI form from maximize?
They don“t have a Max-Button property. I think there may be an API call or something.
Thanks
Even do it looks funny you could add this code in the Resize event:
Code:If Me.WindowState = vbMaximized Then
Me.WindowState = vbNormal
End If
OK, But this code just restores the form to its original size when it is maximized. I need the max button to be disabled.
make the form's border style to fixed single
then look for maximize and minimize on it's properties window ... make minimize true ... the maximize false
then that max button will be grayed out ...
I tried that, but it doesn`t work with MDI forms.
Try this.
Code:Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Const MF_BYPOSITION = &H400&
Private Sub MDIForm_Load()
ModifyMenu GetSystemMenu(hwnd, 0), 4, MF_BYPOSITION, 0, "Maximize"
End Sub