look for advices in resizing forms

I design my forms according to my screen resolution and dimentions. but when I install the same project on other PC I find that the forms and its controls are not at the same location as mine because of the diffrences of screen resolution and settings. are there any common way or advices to solve the situation?
if there is a code , please show it

Thanx  
GouGouAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LordSkitchCommented:
If you're just after form position, use the code...

Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2

or replace Me with any form you need... or put it in a sub like..


Public Sub CenterForm(frmCenter As Form)
frmCenter.Left = (Screen.Width - frmCenter.Width) / 2
frmCenter.Top = (Screen.Height - frmCenter.Height) / 2
End Sub

then you can do..

CenterForm Me  or..
CenterForm frmMain or whatever you need to center


Skitchy
0
GouGouAuthor Commented:
thanx for your answer.
But this is OK for the form. my problem is about the controls' position which may being cut in large screen settings for example 640*480 is completely different than 1024*768 and so on
0
PaulHewsCommented:
Best practice is to design for the smallest screen your program will run on.  Typically, this is 800x600, but if your customer has some 640x480 workstations, then you should try to accomodate them by designing for this size.  If you find you have too many controls to fit the smaller size, then you may have to use a tabbed dialog or other space saver to free up onscreen real estate.  

There are resizers available as third party controls, but they can result in some odd looking screens.  
0
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.

Arthur_WoodCommented:
I agree 100% with PaulHews....I ALWAYS design the Application for the Absolute SMALLEST resolution that will EVER be used for the program.  That way I am sure about the placement of controls, and the real amount of available space on the screen.  That also forces the developer to be realistic about the number of controls that are placed on any one screen.

That does NOT mean, however, that I do not attempt to convince the end users that it is in their own best interest to seriously consider upgrading CRTs to a higher resolution, if at all possible.

AW
0
JohnMcCannCommented:
I agree with the statements so far.

But one further consideration if your forms are covered in things like pictures charts or lists these can be easly resized to fit the form. I typically design to types of form (with respect to your problem).

1) Fixed forms, that cannot be resized these typically contain many textboxes and combos.

2) Full screen forms, these typically will resize but not always.  these forms tend to consist of list controls, grids, pictures, charts and treeviews etc.

The Forms resize event is used to control the size of the list portions.

In theory you could make all forms resizeable but often there is absolutley no need unless you like blank spaces.
0
coreytheBMXprogrammerCommented:
I'm not sure how you get the screen resolution from the computer but there is a way. Check for the users resolution and resize and move all of your buttons etc. throught the code.
0
sameer2010Commented:
The best solution for this will be something like this:
RELATIVE POSITIONING of all controls in the form!!
For this, u can use SCALE command to decide corner coordinates. I generally use upper left as -1,-1 and lower right as 1,1 so that centre is 0,0. Now, place ur controls on the form always with respect to this system. Because corners will be adjusted automatically runtime, remianing distances will also get adjusted giving no problems of positions, and about sizes also you should decide some scale depending on the corner positions of forms. This way ur form will be displayed same on any machine!! Hope this helps u
Thanks
Sam
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

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.