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

Maximize forms without top right buttons

Status
Not open for further replies.

poliv

Programmer
Jun 3, 2000
48
US
How can I maximize a form without show the restore button, or any other, on the top right of the form.
 
I now how to maximize a form. What I want is to maximize without showing the top right buttons on the form.

Thank
 
Im not sure, but cant you invoke the Maximize method on the form (i.e. Me.Maximize) ??

Regards

Liam Corkhill
 
I think I don't explain it right.

When I use me.maximize, or use a macro to maximize the form a restore button appear in the top right of the form, and I don't want to show that restore button, but only maximize the form.

Thanks
 
I know what you mean. I have tried to solve this for ages - no joy. Have fun! :eek:)

Alex Middleton
 
You can make your form a POP-UP. On the OnLoad or OnOpen event, attach the code or reference like the following:

DoCmd.Maximize

 
Another .... different way of doing it.

Set the On Resize event to do a DoCmd.Maximize

When your user restores the window, it will maximize again automatically.

Hope this helps

Liam Corkhill
 
To make it so that the maximize/restore buttons are not present, go to the properties of the form in form design, and on the format tab change the "min max button" property to none. Let me know if this helps ya...Dawn
 
You can disable the MIn Max Buttons on the form properties (Format tab). You can also turn off the Close Button
 
Unfortunately, none of the above suggestions (except Kathie70's) will disable the Close/Exit button when the form is maximised.

When an Access form is maximised, Access automatically adds a functioning Close button to the form. Yes, you can disable the Minimise/Maximise buttons, but NOT the Close button. (Been There, Tried That!)

My Work-around solution was to set the form size so that it filled the screen by dragging the border, and then saving the form. Then when the form was opened, I use the DoCmd.RESTORE command to restore it to that size. The form appears to be maximised, but actually is not. Thus, no Close button.

HTH

Lightning
 
Kathie70, Your solution works, but the menu bar and the tools bar disapear. If you now a way to show the bars and maximize the form, please let me now.

Thanks
 
liamcorkhill

I try your solution but when I push the restore button, the form is restored to is original size and not maximize.
 
Change the form to a pop-up form and change the border Style property on the form to "none". This should get rid of all the buttons in the corner.

You could then create custom command buttons for the user to close the form and a put a rectangle around your form so that it appears to still have a border.

Hope this works for you. B-)
 
Actually, on the format tab there is a "Close Button" field that you can set to no, and it will become ghosted.
 
I can not remember who steered me to the following code,
( I would have liked to give them the credit due)but it
works great for me. remember to include the
DoCmd.Maximize
in your OnActivate event.(I found
that if you switch back and forth between opened forms,
it sometimes does not "maximize" in the right position.)

Place the following in the Form_YourSplashformname_OnOpen
event: RemoveCloseButton Me.hwnd

Copy the following into a NEW module:
************************************************************

Option Compare Database
Option Explicit
Public Const MF_BYPOSITION = &H400
Public Const MF_REMOVE = &H1000

Public Declare Function DrawMenuBar Lib "user32" _
(ByVal hwnd As Long) As Long

Public Declare Function GetMenuItemCount Lib "user32" _
(ByVal hMenu As Long) As Long

Public Declare Function GetSystemMenu Lib "user32" _
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long

Public Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long



Public Sub RemoveCloseButton(hwnd As Long)
Dim hSysMenu As Long

hSysMenu = GetSystemMenu(hwnd, 0)
RemoveMenu hSysMenu, 6, MF_BYPOSITION
RemoveMenu hSysMenu, 5, MF_BYPOSITION
End Sub



************************************************************
I have not had any problems with this since I added it to
my DB.

Jim
 
OOPS!!! I forgot that you need to create your own custom
"menu" bar and in the start up options in the tools menu
select this new custom menu bar and right click on the toolbars select customize and then deselect the access
pre-built menu bar.

Jim

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top