• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

form layout

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
lirong
Asked:
lirong
  • 2
1 Solution
 
p_biggelaarCommented:
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
 
p_biggelaarCommented:
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
 
VKCommented:
you could use the Microsoft Sysinfo-Control and trp the SysInfo_DisplayChanged event

or you could solve it by Subclassing
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now