PC Review


Reply
Thread Tools Rate Thread

Determining wether a form is maximised minimised or restored

 
 
jag
Guest
Posts: n/a
 
      9th Sep 2003
Is it possible to detect when a form is maximised or restored? Does
anybody know how to detect when a form is
maximised or restored?

I have tried using the isZoomed function on my form activate

i.e

Sub Form_Activate()
Dim intWindowHandle As Long
intWindowHandle = Screen.ActiveForm.hWnd
If Not IsZoomed(intWindowHandle) Then
DoCmd.Maximize
End If
End Sub

but I get an error saying that an active window has to be opened.
any ideas?

Thanks
Dee
-------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com



 
Reply With Quote
 
 
 
 
Van T. Dinh
Guest
Posts: n/a
 
      9th Sep 2003
Possibly, because your Form is not "officially" the ActiveForm on screen
yet.

Why bother checking whether it is zoomed or not? Simply use:

DoCmd.Maximize

If the Form is already maximized, Access will ignore your statement. If it
is not maximized, Access will maximize it as you want!

--
HTH
Van T. Dinh
MVP (Access)



"jag" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Is it possible to detect when a form is maximised or restored? Does
> anybody know how to detect when a form is
> maximised or restored?
>
> I have tried using the isZoomed function on my form activate
>
> i.e
>
> Sub Form_Activate()
> Dim intWindowHandle As Long
> intWindowHandle = Screen.ActiveForm.hWnd
> If Not IsZoomed(intWindowHandle) Then
> DoCmd.Maximize
> End If
> End Sub
>
> but I get an error saying that an active window has to be opened.
> any ideas?
>
> Thanks
> Dee
> -------------------------------------------------------------------
> FIGHT BACK AGAINST SPAM!
> Download Spam Inspector, the Award Winning Anti-Spam Filter
> http://mail.giantcompany.com
>
>
>



 
Reply With Quote
 
jag
Guest
Posts: n/a
 
      10th Sep 2003
I actually want the form to be in the restored state not maximised or
minimised,
sorry I know the code isn't quite right I copied the wrong example. Is there
a way to
determine this?

thanks again

dee

--


-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com


"Van T. Dinh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Possibly, because your Form is not "officially" the ActiveForm on screen
> yet.
>
> Why bother checking whether it is zoomed or not? Simply use:
>
> DoCmd.Maximize
>
> If the Form is already maximized, Access will ignore your statement. If

it
> is not maximized, Access will maximize it as you want!
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>
>
> "jag" <(E-Mail Removed)> wrote in message

news:(E-Mail Removed)...
> > Is it possible to detect when a form is maximised or restored? Does
> > anybody know how to detect when a form is
> > maximised or restored?
> >
> > I have tried using the isZoomed function on my form activate
> >
> > i.e
> >
> > Sub Form_Activate()
> > Dim intWindowHandle As Long
> > intWindowHandle = Screen.ActiveForm.hWnd
> > If Not IsZoomed(intWindowHandle) Then
> > DoCmd.Maximize
> > End If
> > End Sub
> >
> > but I get an error saying that an active window has to be opened.
> > any ideas?
> >
> > Thanks
> > Dee
> > -------------------------------------------------------------------
> > FIGHT BACK AGAINST SPAM!
> > Download Spam Inspector, the Award Winning Anti-Spam Filter
> > http://mail.giantcompany.com
> >
> >
> >

>
>



 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      10th Sep 2003
Just use:

DoCmd.Restore

If the Form is being opened restored, it will stay restored. If it is being
opened as maximised or minimised. the DoCmd.Restore will change it to
restored state.

--
HTH
Van T. Dinh
MVP (Access)



"jag" <(E-Mail Removed)> wrote in message
news:3f5e62ca$(E-Mail Removed)...
> I actually want the form to be in the restored state not maximised or
> minimised,
> sorry I know the code isn't quite right I copied the wrong example. Is

there
> a way to
> determine this?
>
> thanks again
>
> dee
>
> --
>
>
> -------------------------------------------------------------------------
> FIGHT BACK AGAINST SPAM!
> Download Spam Inspector, the Award Winning Anti-Spam Filter
> http://mail.giantcompany.com
>
>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop a form being 'non maximised' AussieRules Microsoft VB .NET 1 4th May 2010 09:07 PM
Application opening minimised if closed when minimised TonyFrim Windows XP Help 5 24th Jun 2009 11:15 AM
Create a minimised shortcut for MS Outlook XP, to open minimised =?Utf-8?B?TWFuc2Vs?= Microsoft Outlook Discussion 0 10th Oct 2004 10:53 AM
Maximised form does not stay maximised Tim Microsoft Access Form Coding 1 2nd Mar 2004 04:00 PM
Determining wether a MailItem is a reply Martijn Reijm Microsoft Outlook Program Addins 2 18th Dec 2003 07:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.