Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if a form is Maximized 1

Status
Not open for further replies.

DanielGreenwood

Technical User
May 9, 2002
21
0
0
GB

Hi,

I have a pop up form that contains a calander control (frmCalendar). When I click on a command button (on another form) to open frmCalendar it opens over the command button clicked.

However I have only made it work when the form is not maximized. When I tested it on a maximized form my calendar opens in the wrong place (relative to the restored position).

Is there a way to check if a form is in a maximized state? Or does anyone have any suggetions on how to open a form in a specific position relative to a control on a form?

I can post up the code I'm using if that will help.

Thanks

Dan.
 
This Forms Sample download from microsoft has both example of your choice..

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 

Thanks for the link but I'm working in A97.

I found the solution in the end anyway, here it just for reference:

Code:
'Place this in a normal module
Declare Function IsZoomed Lib "user32" ( _
    ByVal hwnd As Long) As Long

'Then use this in your code, where 'f' is a form object
    If IsZoomed(f.hwnd) <> 0 Then
        MsgBox "Form is Maxed!!"
    Else
        MsgBox "Form not maxed"
    End If


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top