Min/max/close buttons in maximized form 
Author Message
 Min/max/close buttons in maximized form

I use a perhaps rather roundabout method which I think does what you want.
It creates a temporary form, maximizes that, takes its measurements, then
sizes all subsequent forms to those measurements. I'll give the details as I
spent some time getting it to work smoothly.

This is Form_setsize class module. It is closed by the timer event, timer
interval set to 1 in property sheet. The switchboard/menu Form_start, from
which all other forms are opened, is opened by a general module function
openstart(), called by =openstart() at event/activate in setsize property
sheet. If opened by a setsize event proc it would be maximized and have at
least a restore button.

Public maxwi As Integer, maxhi As Integer, menuhi As Integer

Private Sub Form_Load()
  CommandBars.activemenubar.Enabled = False
  maxwi = Me.WindowWidth
  maxhi = Me.WindowHeight                   'widow height without menu
  CommandBars.activemenubar.Enabled = True
  menuhi = Me.WindowHeight                  'window height with menu
End Sub

Private Sub Form_Open(Cancel As Integer)
  Application.RunCommand acCmdWindowHide

'Hides Database window and prevents display zooming visibly
'..WindowhUnhide is in Form_start.closebtn_click()
'needs sendkeys "{enter}" in Form_start.form_close()
End Sub

Private Sub Form_Timer()
  TimerInterval = 0
  DoCmd.close acForm, "setsize"
End Sub

This function is in a general module:

Function openstart()
'setsize leaves menu displayed
  Forms!setsize.Visible = False
  DoCmd.OpenForm "start"                ' main switchboard/menu

  If Form_setsize.menuhi <> 0 Then
    Form_start.maxwi = Form_setsize.maxwi
    Form_start.maxhi = Form_setsize.maxhi
    Form_start.menuhi = Form_setsize.menuhi
    DoCmd.MoveSize 0, 0, Form_setsize.maxwi, Form_setsize.menuhi
  End If

End Function

Subsequent forms opened from start are sized with Form_start.maxwi etc
(declared as Public)

Mon, 07 Oct 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. min/max/close buttons in maximized form (2)

2. Disappearing Min/Max buttons on maximized forms

3. Q128196 Maximized Form Shows Control Box, Min/Max/Restore Buttons

4. Hide the max/min and control buttons on maximized form

5. Q128196 Maximized Form Shows Control Box, Min/Max/Restore Buttons

6. Disable Min/Max/close buttons in a form

7. hiding title bars and min/max/close buttons on forms

8. min/max/close buttons on form

9. Disable Min, Max, and Close Buttons

10. Deactivating Min/Max/Close Buttons on Workbook Toolbar

Powered by phpBB® Forum Software © phpBB Group