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

Rescale forms with diff. resolutions!!!

I'm using VB6 & Win98 and I really need help.

I designed ALL my forms under screen resolution 1024*768.  The program works & looks fine until I change my resolution to 800*600:

All my forms don't fit within the monitor screen (e.g. the title bar is outside the top of the monitor screen, so I cannot even move the forms around).

(1) How to rescale every form automatically in VB when the screen resolution changes?  This of course includes rescaling all combo boxes, text boxes, etc.

(2) If it cann't be done automatically, what's the next best solution?

Tnx a lot,
0
leesss
Asked:
leesss
  • 4
  • 3
  • 2
  • +3
1 Solution
 
caraf_gCommented:
The best solution (sorry) is to redesign your forms for 800x600 resolution, and then NOT rescale them at all for higher resolutions.

It will definitely be the solution most popular with your customers.
0
 
leesssAuthor Commented:
I've tried using the form.scalemode = pixel, but it doesn't seem to be any different than twips.
0
 
mcriderCommented:
caraf_g is right... Always build your forms using the lowest resolution you will support.  That way, you *know* what it's going to look like.


Cheers!®©
0
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.

 
caraf_gCommented:
Oh, it's quite different alright.
0
 
CrinCommented:
Hello,

By the way, SOME part of the code is possible to write, BUT some controls width/height depends on system settings (for example ComboBox or ListBox)...

True solution was given by caraf_g: redesign your form in 800x600.

Also some tips:
keep in mind color settings, the same reason to use 16 colors if no needs to use True or HighColor
while design play with Display settings (mostly 'Appearence' tab) - change border width, Button face/font colors etc and check what happen t6o your forms...
To prevent color troubles you can use palette mode, not system colors...

Sincerely yours,

Crin

0
 
mark2150Commented:
Rescaling the controls isn't hard. Tricky part is getting the text to come out right.

Bite the bullet, reset to the rez you originally used and then resize everything to fit at 800x600. This is why there is a "Form Layout Window" under the View option in the IDE. So you can make sure that a screen will fit OK when you build on a system with higher rez than your users will normally have.

M
0
 
justinflitcroftCommented:
To fix your problem, you should write a subroutine or function that positions all the controls on form load. You must do this not using absolute measurements, but multiples of Screen.TwipsPerPixelX or Screen.TwipsPerPixelY. You will have to determine the value of these variables on your system, and caculate the multiples based on this. For example, if one of your controls had a top value of 150, and your Screen.TwipsPerPixelX is 15, you would write code such as control.top = (Screen.TwipsPerPixelX * 10).
I hope this helps.
0
 
caraf_gCommented:
Nonsense.

If you do that, your forms are guaranteed to look non-standard the moment you resize them.

The problem with resizing forms is that certain controls should not resize. A typical example would be a check box or an option button. Frames normally don't resize either as they are like little sub-forms with their own optimised layout.

Other controls, such as list boxes and treeviews, can resize freely.

The controls that are not to be resized can often be placed in one of four regions:

1 Top Left - These controls do not move nor resize.
2 Top Right - These controls stay in the same top positions but stay "anchored" to the right hand border of the form.
3 Bottom Left - Controls stay in same Left position but are anchored to the bottom of the form
4 Bottom Right - Controls are anchored to bottom right hand corner.

The other controls can then be resized with the form.

You'd normally have to provide a minimum size for your form. Not provided in this example.

Check out http://homepage.eircom.net/~carafa/VBSamples/VB6/ResizeSample.frm for a slightly better solution.

0
 
leesssAuthor Commented:
Thanks for all the inputs, they are really helpful.  I'll wait for 1 more day before I honor my points.
0
 
leesssAuthor Commented:
justinflitcroft,

sorry that I have to reject your answer, since I believe caraf_g is right...

caraf_g, could you claim an answer so that I could honor your points
0
 
mark2150Commented:
You can "Accept Comment as Answer" anytime.

M
0
 
caraf_gCommented:
Thanks a mill!
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

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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