Hiding restore button

tbeegz

Registered User.
Local time
Today, 11:06
Joined
Mar 28, 2002
Messages
10
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.
 
In the Form's properties list, look for "Min Max Buttons" and set it to NONE.

BL
hth
 
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
 
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.
 
Is there an easy way to remove the Access application min/max buttons? I assume it's some kind of api thing...?
 
KenHigg said:
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.

Code:
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
 
Hum - Cool. Thanks for the quick resonse.
 

Users who are viewing this thread

Back
Top Bottom