Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Problems, Different Sizes on different pcs 1

Status
Not open for further replies.

mordja

Programmer
Apr 27, 2004
294
GB

Hi,

Im having a problem with form sizes. Ive developed a database with several forms. All forms are a full screen size with no scroll bars. The problem is that on some pcs the form is a lot bigger than the screen size and to view it scroll bars are needed. How do I develop forms so that they remain the same size(full screen) on any pc?

Thanks

Mordja
 
1) make sure all pcs are displaying the same screen resolution.
2) see suggestion 1. [smile]
Sorry if the response seems flippant - as I typically have little or no control over the various screen resolutions, I try to make it look good on the smallest resolution I expect to find (800 x 600) or (1024 x 768) and hope for the best.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
The easiest solution is to design for the smallest screen and centre the forms on larger screens. Stretching controls to fit different screen sizes is a nightmare. You can resize text boxes but do you change the font size or do you display more text on the bigger screen? And some controls like option buttons and tick boxes look odd because they are always the same size.

Geoff Franklin
 
I agree with alvechurchdata. I generally build my forms to accomodate the smallest resolution and then center the form on the larger one. However, with the code below, you could enable/disable the scroll bar based on the size of the screen. That is, change the DoCmd.Restore and DoCmd.Maximize to Me.Scrollbars=0 and Me.Scrollbars=3.

Code:
Public Declare Function apiGetSystemMetrics Lib "User32" Alias "GetSystemMetrics" (ByVal nIndex As Integer) As Integer

Add the following code to the OnActivate event of the form.

Code:
Private Sub Form_Activate()

    If (apiGetSystemMetrics(16) > 800) Then    'Returns size of screen (width) 17=height (i.e. 800x600)
        DoCmd.Restore
    Else
        DoCmd.Maximize
    End If
        
End Sub
 
Hey,

Thanks everyone for the reply, looks like I have to design for a smaller resolution.

Thanks

Mordja
 
FancyPrairie,

Nice, just tried your suggestion out.

Mordja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top