Solved

VB Form design.

Posted on 1998-11-27
10
587 Views
Last Modified: 2013-12-03
My program contains a form, one textBox, one command button and  one label.
My problem is I want to stretch or shrink on run time and I want all the controls
In the form to resize specially the fonts. I would like also to know how to approach
The problem of running the program in different machines with different font and
Resolution configurations.
If I don’t allow the form to resize dynamically how should I start it  at the beginning with
A reasonable size and font? How should I inquire at installation time the state of the machine
Like the size of the screen, the resolution and the font size it is using and then using that
Information to size my forms and the controls on them.
I want a general advice and where to look for information about that and may be some example code
If possible.  I am a programmer but just started learning VB5-6.
I tried the domo program from videosoft vsElasticLight but It is not working fine for me specially
Fonts and when I run my program with other machines with different settings.

Thank You
0
Comment
Question by:yassin092898
[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
10 Comments
 
LVL 2

Expert Comment

by:trillo
ID: 1447165
Hmmm, I've faced that problem several times in proffessional applications and this is what I think: You don't need to stretch or rezise the form depending on the screen resolution, the only thig you have to take care is that your non-rezisable windows do not pass 640 x 480 pixels. Your dialog will be fine in any computer...If you enlarge your forms on high-resolution screens, your dialogs will look ugly and with a lot of wasted space... It's very simple, if your app is running on a high resolution screen, your dialog will "appear" smaller than in a low resolution screen, but it will look nice, if you enlarge the controls and the fonts, your app will look like a program for babies... but as I said before, that's just my opinion.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1447166
You can make use of the autosize feature of an invisible label. Just increase the font size of this label and see how big it is now.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1447167
Yassin, don't change the size. People are buying larger monitors and using better resolution to see more information, not to see enlarged information.
Always program to fit 640*480 screen, as trillo said.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mark2150
ID: 1447168
In my code I've gone the full resize option a couple of times. I design at 640x400 and scale up from there as the screen rez increases. If you have a main module you can do the work in there before the forms become visible. You can scale up the .Width and .Height properties. Fonts, however, are another issue. If you pick a decent true type font you can scale up as required, but due to the nature of proportional fonts not all scalings will look good. You can do stuff with the .FontSize property but some fonts seem to jump quite a bit for a small (2pt) size change. Additionally some fonts automatically switch to a BOLD version when their font size increases past a certain point and this can cause your prompts to suddenly expand beyond their intended boundaries.

Ameba makes a good point, if you scale up your app's screen real estate as the rez goes up the user is not going to gain any benefit from their investment in larger monitor/better video if every program auto scaled.

M

0
 
LVL 1

Expert Comment

by:zivf
ID: 1447169
Mirkwood, you are truely some thing.
I once heard a saying from one math professor in the uni:
Every complicated question has one short simple and wrong answer.
Think about it a while and go back to read you comment in this thread.
0
 

Author Comment

by:yassin092898
ID: 1447170
This is Yassin the owner of this complicated question.
I think the following comments from Trilo and  ameba
gave the best hint.
"You don't need to stretch or rezise the form depending on the screen resolution, the only thig you have to take care is that your non-rezisable windows do not pass 640 x 480 pixels" ..trilo

and "Always program to fit 640*480 screen, as trillo said." ..ameba

I thank Mirkwood's comment but that applies to test example I
already tried before I posted this question and it is the only
question I looked and couldn't figure out how I can make use
of it.
Zivf good comment and you gave me a valuable hint, could you
advice too.

Now I must tell you that this is my first attempt in writing
an application of this requirement.
what does  "Always program to fit 640*480 screen" mean.
 My machine is 17", 1024X768, and at design time my main form fits nicely.
Do I have to do any setting at design time or do I have to do some coding?
Thank You All




0
 

Author Comment

by:yassin092898
ID: 1447171
Adjusted points to 180
0
 
LVL 15

Expert Comment

by:ameba
ID: 1447172
>1024X768, and at design time my main form fits nicely

You must test your program with other resolutions (640*480,800*600).
Check also another Appearance Scheme (I use normally "Windows Standard", and check releases with "Rainy Day" scheme)
Sometimes I check software also with "Large Font" setting.

If you check this things, you will not have users' calls with problems like: wrong size of your Splash screen, wrong colours, or "does not fit" problems.

It is very common mistake to have large data entry screens with  15 or more entry fields per screen. If you have this, use Tabstrip control. To see how it works, add Options form (it is in your Form templates). You can see its use in e.g. Address Book in Outlook Express, or in any OS Properties window.

Of course, you can allow your users to use more then 640*480 if they want - like in Notepad, or with lists. Use resize event to position/resize your control(s).

For fixed-size forms, do not go over: 640x452 pts
For fixed-size MDI-Childs, do not go over: 600x390 pts

There are some rare possible situations, e.g. your client has requirement to see list of Customers, Customers details, list of Orders and Graph of payments on one screen, then use 800x600. But be aware that your software will not show well on most Laptops and some PCs with 14' screens. You can add this line to your startup form:
    If Screen.Width  <  800 * Screen.TwipsPerPixelX  Then
        MsgBox "This software requires better resolution. ..."
    End If

And don't be bothered with a lot of free space on your 17'. Most users will rarely run only one program at the same time.

0
 

Author Comment

by:yassin092898
ID: 1447173
Ameba thanks for your effort and I thank the many other experts who adviced me in this question. Anyone can still add some more comments but I want to stop adding any more cooments. I am ready
to award the points and full marks but someone has to claim I think.


0
 
LVL 15

Accepted Solution

by:
ameba earned 180 total points
ID: 1447174
>someone has to claim I think
No problem.

PAQ (previously asked questions) readers: See comments
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

628 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