locked
Hide / Show footer if the application window is maximized RRS feed

  • Question

  • Howdy,

    I can make the footer of a form visible / hidden (Me.FormFooter.Visible = False).

    I can make the application window maximized (Application.DoCmd.Maximize)

    How can I check if the application window is maximized and show the footer only if it is?

    /Joe

    Sunday, June 17, 2012 8:50 AM

Answers

  • Enter on single line in Declarations section of Module window:

    Declare Function IsZoomed Lib "user32" (ByVal hWnd As Long) As Long

    Put the code below in the forms On Resize event

    Private Sub Form_Resize()
    Dim intWindowHandle As Long
    intWindowHandle = Screen.ActiveForm.hWnd
      If IsZoomed(intWindowHandle) Then
        Me.FormFooter.Visible = True
      Else
        Me.FormFooter.Visible = False
      End If
    End Sub



    Bob Fitz BizSoftware

    • Marked as answer by Model_m Monday, June 18, 2012 6:48 AM
    Sunday, June 17, 2012 10:03 AM

All replies

  • Enter on single line in Declarations section of Module window:

    Declare Function IsZoomed Lib "user32" (ByVal hWnd As Long) As Long

    Put the code below in the forms On Resize event

    Private Sub Form_Resize()
    Dim intWindowHandle As Long
    intWindowHandle = Screen.ActiveForm.hWnd
      If IsZoomed(intWindowHandle) Then
        Me.FormFooter.Visible = True
      Else
        Me.FormFooter.Visible = False
      End If
    End Sub



    Bob Fitz BizSoftware

    • Marked as answer by Model_m Monday, June 18, 2012 6:48 AM
    Sunday, June 17, 2012 10:03 AM
  • Bob,

    This seems to be referring to the form size within the MS Access windows. Do I need to modify it for the application window?

    /Joe

    Sunday, June 17, 2012 12:09 PM
  • I would assume the same code applies, but you would have to use the window handle of the main Access window, which is Application.hWndAccessApp


    -Tom. Microsoft Access MVP

    Sunday, June 17, 2012 4:06 PM
  • I can make the application window maximized (Application.DoCmd.Maximize)

    Note:  DoCmd.Maximize does not maximize the application window.  Instead, it maximizes the child windows inside the application window.  I'm not sure which you had in mind.  If it helps, the command to maximize the application window is:

        RunCommand acCmdAppMaximize


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Sunday, June 17, 2012 9:14 PM
  • Bob, Tom and Dirk,

    Thank you all.  I'll play with it and see how it goes.

    Thank you,

    Joe

    Monday, June 18, 2012 6:49 AM