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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get rid of RESTORE Button in Forms 1

Status
Not open for further replies.

waldemar

Programmer
Nov 15, 2001
245
DE
I want the user not to be able to close forms on himself... which works fine on regular form (disabling system buttons property etc.), but if the form maximized (DoCmd.Maximize) I keep getting the Restore Button in the upper right Corner... Does anybody know a way to get rid of this one?

Regards
waldemar
 
don't allow the maximize button, either. If the form needs to be maximized, then have a docmd.maximize in the form_load.

You can turn off this stuff by turning off Min Max Buttons, Controll Box, and optionally setting border style to none.

HTH!

-Brad
 
Thanks blarson

Everything is OFF (min/max, close, controlbox, close, border style, help button) but as soon as the form is maximized it gets still this single restore button...

waldemar
 
Well... um... I found a solution... not that it is a good solution...

If you are wanting to not allow the user to close the form, do this:

Private Sub Form_Unload(Cancel As Integer)
Cancel = True
End Sub

This won't let them close the form at all. or access. The only way out is ctrl-alt-del. I suggust adding a way to break out, so something like this:

Private Sub Form_Unload(Cancel As Integer)
If Not canclose Then Cancel = True
End Sub

and have a hidden button or key combination to turn canclose true

HTH

-Brad
 
Thanks, thats a cool idea...
.... but the Close Button is no problem... that one did go perfectly (Closebutton property of the form)... the RESTORE Button (as in Oppisite to Maximize) is the only one left (MinMaxButtons is set to None already)...
 
here is (yet another) workaround

I couldn't figure out how to get rid of the restore button, so if anyone knows how that would be much better

for now, you can call doCmd.maximize whenever your form is resized. unfortunatly, access will ignore doCmd.maximize in a form_resize() sub. here is a workaround:




Private Sub Form_Resize()
Me.TimerInterval = 1
End Sub

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



HTH!

-Brad
 
Change the BorderStyle property to "Thin". This won't allow resizing of the form at runtime; you can minimize it but not change the open size (I always do this to keep people from messing around with the layout).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top