View Full Version : Hiding restore button


tbeegz
03-28-2002, 09:30 AM
How do I hide the restore button on a form. I have taken off everything else (min/max buttons, toolbar, etc.) but cannot find a way to get the restore icon off.

boblarson
03-28-2002, 10:58 AM
In the Form's properties list, look for "Min Max Buttons" and set it to NONE.

BL
hth

jfisher4
07-30-2003, 06:54 AM
If I may once again resurrect an old thread... I too have this problem. Setting the min max buttons to none in the properties doesn't remove the restore button for me. When a user clicks on this it exposes the database window in the background. Which I would prefer to keep out of site. Is there any other solution to remove this button?
Thanks

ghudson
07-30-2003, 06:57 AM
Do not maximize your form.

jfisher4
07-30-2003, 11:12 AM
I never dreamed the answer was so easy. Thanks. I want the form to appear maximized and fill the screen so I guess I need to do that through code.

KenHigg
12-14-2005, 11:24 AM
Is there an easy way to remove the Access application min/max buttons? I assume it's some kind of api thing...?

nateobot
12-14-2005, 11:49 AM
Is there an easy way to remove the Access application min/max buttons? I assume it's some kind of api thing...?

easy and api usually don't go together. ;)

This doesn't remove them, but disables them from being used.


Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Integer
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal iditem As Long, ByVal wFlags As Long) As Integer
Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long

Private Const MF_REMOVE = &H1000&
Private Const SC_CLOSE = &HF060
Private Const MF_BYCOMMAND = &H0
Private Const MF_GRAYED = &H1
'private Const SC_MOVE = &HF010

Const SC_MAXIMIZE = &HF030
Const SC_MINIMIZE = &HF020


Private Sub Command2_Click()
Dim hMenu As Integer, Success As Integer
Dim nPosition As Integer
Dim idNewItem As Integer
Dim s As String

'MDIForm1.Show
hMenu = GetSystemMenu(Access.Application.hWndAccessApp, 0)

Success = DeleteMenu(hMenu, SC_CLOSE, MF_REMOVE Or MF_BYCOMMAND)
Success = DeleteMenu(hMenu, SC_MINIMIZE, MF_REMOVE Or MF_BYCOMMAND)
Success = DeleteMenu(hMenu, SC_MAXIMIZE, MF_REMOVE Or MF_BYCOMMAND)
End Sub

KenHigg
12-14-2005, 11:54 AM
Hum - Cool. Thanks for the quick resonse.