Solved

VB Form design.

Posted on 1998-11-27
10
571 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
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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now