Forms Sizing

M

mbox204

Hello and thank you for assisting.

I recently programmed an Access DB on a system with 1024 x 768 screen
resolution. I also incorporated one of the popular modules to resize forms,
refereneced on this NG. I find now that the actual users of this
application have screen resolutions of 800 x 600 and they are not going to
change just to run my application in 1024 x 768 mode. Without going back to
redue 20 forms for their specific resolution, can I set the monitor
resolution at startup with some code, to at least get it so it will have
1024 x 768 resolution for the application run, then change back on
application close. The form resize procedure is great going forward from
lessor to greater resolution, not in reverse.

I will have to take the blame for this, though the PC at the work place I
did preliminary work on was a 1024 x 768 resolution.
 
J

John Spencer (MVP)

Well, if you did this on my computer, I would immediately come looking for you
(and not to exchange pleasantries). If you change the resolution for one
application, you change it for all applications and I don't like the effect when
I am working in a word document or other application at the same time I am
working in Access. I would be particularly upset if I was working in your
application, opened another application (such as word) and grew the screen and
then closed your Access application. All of a sudden I would have to work at
resizing any open windows.

It can be done.

As hard as it is, I would suggest that you redesign your forms to run on 800 by
600. That should not be too hard, even though it will be tedious.

However, IF you talk to your users AND if they agree, then take a look at

http://www.mvps.org/access/api/api0029.htm

Again, I urge you to consider how your users will react to your doing this.
 
G

Guest

Hi

This requires calls to the Windows API. Create a module with the following
code:

'module code
'=========================================
Option Compare Database

Private Const CCDEVICENAME = 32
Private Const CCFORMNAME = 32
Private Const DM_PELSWIDTH = &H80000
Private Const DM_PELSHEIGHT = &H100000

Private Declare Function EnumDisplaySettings Lib "user32" _
Alias "EnumDisplaySettingsA" _
(ByVal lpszDeviceName As Long, _
ByVal iModeNum As Long, _
lpDevMode As Any) As Boolean

Private Declare Function ChangeDisplaySettings Lib "user32" _
Alias "ChangeDisplaySettingsA" _
(lpDevMode As Any, _
ByVal dwflags As Long) As Long

Private Type DEVMODE
dmDeviceName As String * CCDEVICENAME
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * CCFORMNAME
dmUnusedPadding As Integer
dmBitsPerPel As Integer
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
End Type


'this function below will change the resolution
Sub ChangeRes(iWidth As Single, iHeight As Single)
Dim blnWorked As Boolean
Dim i As Long
Dim DevM As DEVMODE

i = 0

Do
blnWorked = EnumDisplaySettings(0&, i, DevM)
i = i + 1
Loop Until (blnWorked = False)

With DevM
.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
.dmPelsWidth = iWidth
.dmPelsHeight = iHeight
End With
Call ChangeDisplaySettings(DevM, 0)
End Sub
'=========================================

Then just create a call to ChangeRes(width, height) and bobs your mother's
brother.

Hope this helps

Ashley Bragg
(e-mail address removed)
Consultant
 
M

mbox204

I think the first thing I will do is speak with them about this situation.
In the meantime, I have implemented the code on open of the application with
(1024, 768) values, then called the same function with values (800, 600) on
close of the application to restore default settings. While I redevelop
forms for 800 x 600 format, this should suffice.

Thank you for assisting me.
 
J

John Spencer (MVP)

I hope that you check what the settings are when you open the application, store
those settings, and then restore to the original values and not simply assume
that they started at 800x600.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top