• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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