Determine WindowState of a Form

  • Thread starter Thread starter Alphonse Giambrone
  • Start date Start date
A

Alphonse Giambrone

Is there any way to determine the windowstate of a form in Access 2k (or
other)?
I am trying to determine if a form is maximized or not and was very
surprised to find no Windowstate property.
 
Alphonse Giambrone said:
Is there any way to determine the windowstate of a form in Access 2k
(or other)?
I am trying to determine if a form is maximized or not and was very
surprised to find no Windowstate property.

If you put this API function declaration into a standard module:

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

then you can test whether a form is maximized by calling the function
with the form's Hwnd property:

If IsZoomed(Forms!MyForm.Hwnd) Then
' the form is maximized
Else
' it isn't.
End If
 
Back
Top