Full Screen

  • Thread starter Thread starter Graham Naylor
  • Start date Start date
G

Graham Naylor

Hi,

These are probably easy questions but the help system in my copy of Access
(Office 2000) and I don't know the answers.

Using VBA code how do you acheive the following

1. Make a form full size (so it fills the Application window)?

2. Make the Access application full screen?

Thanks

Graham
 
Hey there...

This sould assist. If you can't cut and paste it, email
me directly and I will send it to you via plain text


Const SW_MAXIMIZE = 3
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWNORMAL = 1

'Access Handles -------------------------------

Declare Function apiGetActiveWindow Lib "User32"
Alias "GetActiveWindow" () As Long
Declare Function GetSystemMetrics& Lib "User32" (ByVal
nIndex&) ' this one will allow you to get the info about
the screen from the OS. Search MSDN.Microsoft.com for
info on how to use it.

Public Function SetApplicationSize()
Dim TmpWidth As Integer, TmpHeight As Integer
Dim iSLeft As Integer, iSTop As Integer
Dim daWidth As Long, daHeight As Long

TmpWidth = 615 'you can set these to the display size
TmpHeight = 550 'this one to
iSTop = 0
iSLeft = 0

AccessMoveSize iSLeft, iSTop, TmpWidth, TmpHeight
End Function

Public Function AccessMoveSize(iX As Integer, iY As
Integer, iWidth As Integer, iHeight As Integer)
MoveWindow GetAccesshWnd(), iX, iY, iWidth, iHeight,
True
End Function

Public Function GetAccesshWnd()
Dim hWnd As Long, hWndAccess As Long

hWnd = apiGetActiveWindow()
hWndAccess = hWnd

' Find the top window without a parent window.
While hWnd <> 0
hWndAccess = hWnd
hWnd = apiGetParent(hWnd)
Wend

GetAccesshWnd = hWndAccess

End Function
 
Back
Top