Solved

form layout

Posted on 2001-06-11
3
149 Views
Last Modified: 2010-05-02
Hi

How can I configure a form and its object sizes, to change when the display changes. For example, if the form opens on 800/600 or 1024/768
Thanks,

Liron
0
Comment
Question by:lirong
  • 2
3 Comments
 
LVL 2

Expert Comment

by:p_biggelaar
ID: 6176437
You can use the Form's resize event to position and size control's on the form. There are a couple of things you can use to determine the size and state of the form, like:

WindowState: Can be vbMinimized, vbMaximized or vbNormal. When state is vbMinimized, sizing controls can lead to errors, so check it!

Form.Width and Height give you the 'outer' width and height of a form, while Form.ScaleWidth and Form.ScaleHeight will give you the usable area of a form.
0
 
LVL 2

Accepted Solution

by:
p_biggelaar earned 200 total points
ID: 6176457
Another nice thing to know about is the screen object. This line of code, will give you the currently selected resolution.

    MsgBox "Resolution = " & Screen.Width / Screen.TwipsPerPixelX & "/" & Screen.Height / Screen.TwipsPerPixelY

0
 
LVL 6

Expert Comment

by:VK
ID: 6176538
you could use the Microsoft Sysinfo-Control and trp the SysInfo_DisplayChanged event

or you could solve it by Subclassing
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now