Results 1 to 6 of 6

Thread: Simple Question (I Think...)

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Chile
    Posts
    4

    Question

    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
    --
    rtoro

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Chile
    Posts
    4
    OK, But this code just restores the form to its original size when it is maximized. I need the max button to be disabled.
    --
    rtoro

  4. #4
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305
    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 ...

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Chile
    Posts
    4
    I tried that, but it doesn`t work with MDI forms.
    --
    rtoro

  6. #6
    Guest
    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
  •  



Click Here to Expand Forum to Full Width