Another DB Window Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

One more for the deep, dark, guts-of-Access folks...

When a form is maximized, a "restore" button appears to the upper right in
the db window. Is there some way to either prevent it from showing or
disabling it? I have a "full-screen" form (BorderStyle = None) that I don't
the user to be able to minimize or restore.

Thanks,
Bruce
 
BruceS said:
When a form is maximized, a "restore" button appears to the upper right in
the db window. Is there some way to either prevent it from showing or
disabling it? I have a "full-screen" form (BorderStyle = None) that I don't
the user to be able to minimize or restore.

That would be a violation of the Windows User Interface
guidelines.

Not only that, but when you remove (using the form's
MinMaxButtons property) those buttons, it also prevents the
form from being maximized.
 
Marsh,

Thanks for replying. Don't think we're communicating here...

I'm not refering to Access window, but to a form that opens within the grey
background database window, under the Access menu and command buttons.

In the Load and Activate events of that form ("Main") I placed
DoCmd.Maximize so that it fills the Access database window and automatically
re-maximizes if a different form or report is opened from it, then closed.
This works fine.

When Main is maximized, however, a little grey "restore" icon appears just
above the opened form on the right side of the screen. That's the one I want
to nuke so that the user can't mess with how it's displayed.

Bruce

PS: I'll play with your reply to my other question. Looks like it should
work, though.
 
I was talking about a form window this time, so I guess
we're even on who misunderstood who ;-)

Think about it though, if you remove (hide) the minimize
button, the form's window can no longer be manipulated and
thus can not be maximized either. Play with the form's
MinMaxButtons property (and what happens to another open,
maximized form when you select one or the other (using the
Window menu). There's actually a subtly useful trick here.

Bottom line, if you want a form to be sized as if it were
maximized, you first have to use API calls to manuplate the
Access window to the desired size and/or retrieve the size
of the Access window. Then, you can use the MoveSize method
to make the form large enough to fill the Access window
wihout maximizing it. Personally, I have never wanted to
take control the user's system so they can not do the same
things with my apps that they can do with other standard
programs. While I have never worked out the APIs necessary,
I am sure someone has and Google should find some examples.
 
Thanks, Marsh. I just looked at the KB article Van referenced, and believe
that will do the trick.

BTW, the purpose of this is to control a "touch screen" form for a
manufacturing machine. Operators aren't very computer literate, so I'm
trying to eliminate any chance they can screw it up by doing something they
shouldn't. Tons of error trapping, limited menus, etc. It's amazing that
the GUI requires 90% of the time! The machine logic is really pretty simple.
(But don't tell my client!)

Best,
Bruce

Marshall Barton said:
I was talking about a form window this time, so I guess
we're even on who misunderstood who ;-)

Think about it though, if you remove (hide) the minimize
button, the form's window can no longer be manipulated and
thus can not be maximized either. Play with the form's
MinMaxButtons property (and what happens to another open,
maximized form when you select one or the other (using the
Window menu). There's actually a subtly useful trick here.

Bottom line, if you want a form to be sized as if it were
maximized, you first have to use API calls to manuplate the
Access window to the desired size and/or retrieve the size
of the Access window. Then, you can use the MoveSize method
to make the form large enough to fill the Access window
wihout maximizing it. Personally, I have never wanted to
take control the user's system so they can not do the same
things with my apps that they can do with other standard
programs. While I have never worked out the APIs necessary,
I am sure someone has and Google should find some examples.
--
Marsh
MVP [MS Access]

Thanks for replying. Don't think we're communicating here...

I'm not refering to Access window, but to a form that opens within the grey
background database window, under the Access menu and command buttons.

In the Load and Activate events of that form ("Main") I placed
DoCmd.Maximize so that it fills the Access database window and automatically
re-maximizes if a different form or report is opened from it, then closed.
This works fine.

When Main is maximized, however, a little grey "restore" icon appears just
above the opened form on the right side of the screen. That's the one I want
to nuke so that the user can't mess with how it's displayed.

PS: I'll play with your reply to my other question. Looks like it should
work, though.
 
Van,

This is probably one of those stupid, silly things on my part, but I keep
getting an Error '13': Type mismatch when I try to run Terry Kreft's code.
Here's what I have:

Private Sub Form_Load()
....
Dim Frm As Form
....
Set Frm = Forms ("Main")
MaximizeRestoredForm (Frm)
Set Frm = Nothing
....

Error occurs on the "MaximizeRestoredForm" line. The function defines the
parameter as a Form. Does it mean that in the "Access form" sense or as
something more "Windows" related? (Running Access 2003 on an A2K database
under Win XP Pro.)

Thanks,
Bruce
 
I normally use:

Call MaximizeRestoredForm(Me)

in the Activate Event of the Form that I want to occupy the whole Access
Application window without the Close / Restore button. The advantage of
using the Activate Event is that if you have multiple Forms open, this Form
will always occupy the whole Access Application window whenever it is the
active Form.
 
Van,

As they say in real estate: location, location, location! I moved call to
Activate event and it worked great!

Many thanks for your patience and your help on my two issues!

Bruce
 
Back
Top