Solved

form layout

Posted on 2001-06-11
3
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

617 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