Connecting Tech Pros Worldwide Forums | Help | Site Map

Keeping a form maximised?

What-a-Tool
Guest
 
Posts: n/a
#1: Nov 13 '05
I have a main form that is my start-up form. I want this form to be
maximized all the time, so in the code for Form_Load I have DoCMD.Maximize.
However, as soon as I open another form that is not maximized, this Main
form loses its maximized state and the forms kinda Tile themselves.

Any suggestions as to how I can keep this form maximized all the time?

Anyone know of a way that I can get the size of the application display area
so my form can be sized on startup maybe? (I don't need the code - just to
be pointed toward the correct object and property)

Thanks for any help

--

/ Sean the Mc /

"Opinions are like flatulence - everyone loves the sound of their own, but
anyone else's usually just stinks !"
-anonymous




Rog
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Keeping a form maximised?


When you maximize -or restore- a form, you maximize or restore the
whole application. Only pop-up forms keep their original size. What
you can do is maximize your form "on activate", that way it will
maximize again when it becomes active again.

What-a-Tool
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Keeping a form maximised?


Thanks for the suggestion - Best I have now.

Anybody know of a way to get the display area height and width?

--

/ Sean the Mc /

"Opinions are like flatulence - everyone loves the sound of their own, but
anyone else's usually just stinks !"
-anonymous


"Rog" <delahayerc@state.gov> wrote in message
news:1109781762.570202.83300@z14g2000cwz.googlegro ups.com...[color=blue]
> When you maximize -or restore- a form, you maximize or restore the
> whole application. Only pop-up forms keep their original size. What
> you can do is maximize your form "on activate", that way it will
> maximize again when it becomes active again.
>[/color]


Darryl Kerkeslager
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Keeping a form maximised?


"What-a-Tool" <Die!FrigginSpammers!DieDie!@IHateSpam.Com> wrote[color=blue]
> Thanks for the suggestion - Best I have now.[/color]


This may be more than you are looking for, but I have used this method
successfully to keep several of my primary forms maximized. In each of the
forms that I want to remain maximized always, I add the following:

Private Sub Form_Resize()
If GetMaximize(Me.Name) Then Me.TimerInterval = 1
End Sub

Private Sub Form_Timer()
DoCmd.Maximize
Me.TimerInterval = 0
End Sub


In a module:

Private shouldMaximize As Boolean

Public Sub SetMaximize(doMax As Boolean)
shouldMaximize = doMax
End Sub

Public Function GetMaximize(callingForm As String) As Boolean
GetMaximize = shouldMaximize
End Function

I only actually call SetMaximize twice - once, to set it to false as each of
the primary forms are opened:

SetMaximize False
With DoCmd
.OpenForm "HomeForm", , , , , acHidden
.OpenForm "OffenderForm", , , , , acHidden
.OpenForm "AddressForm", , , , , acHidden
.OpenForm "InvestigationForm", , , , , acHidden
.OpenForm "ObligationForm", , , , , acHidden
.OpenForm "PhotoForm", , , , , acHidden
.OpenForm "DocForm", , , , , acHidden
.OpenForm "SupervisionForm", , , , , acHidden
End With

and shortly after, when they are loaded:

SetMaximize True. The SetMaximize is necessary to prevent flicker on
opening the primary forms.

Drawback: Reports can only be previewed from one of the primary forms, not
from a called dialog form, otherwise the report 'hides' behind the primary
(maximized) form.




Darryl Kerkeslager


Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927


Closed Thread


Similar Microsoft Access / VBA bytes