|
-
Aug 31st, 2000, 11:47 AM
#1
Thread Starter
New Member
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
-
Aug 31st, 2000, 11:52 AM
#2
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
-
Aug 31st, 2000, 11:58 AM
#3
Thread Starter
New Member
OK, But this code just restores the form to its original size when it is maximized. I need the max button to be disabled.
-
Aug 31st, 2000, 12:16 PM
#4
Hyperactive Member
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 ...
-
Aug 31st, 2000, 12:23 PM
#5
Thread Starter
New Member
I tried that, but it doesn`t work with MDI forms.
-
Aug 31st, 2000, 12:42 PM
#6
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|