Solved

form layout

Posted on 2001-06-11
3
165 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

734 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