Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dealing with diferent screen resolutions 2

Status
Not open for further replies.

elquixiote

Technical User
Nov 30, 2002
99
MX
Hi! is there a way to deal with text sizes so your text can fit in your screen regardless the screen resolution the user is using.

thanks ...

El quijote ...

 
elquixiote,

At the simplest level you could get the screen size and then just adjust the font size in your controls.

Private Sub Form_Load()

Select Case Screen.Height / Screen.TwipsPerPixelY

Case Is <= 600
Label1.FontSize = 6
Case Is <= 100
Label1.FontSize = 8
Case Else
Label1.FontSize = 10
End Select

End Sub


Consider you will probably have to readjust control sizes and the containing Form too.

At another level I think you can obtain ActiveX controls which when placed on a Form will automatically rescale everthing on it depending on the Windows Desktop resolution.

At the final level seriously consider if its worth doing. An app released today is unlikely to be run on a computer more than a few years old, most of these will support and should be using resolutions of 1024*768 or greater. So you could just design your app to fit on 1024 * 768 and forget the resizing issue. Your decision may depend a little on whether you are producing a game or a business app.

regards Hugh,
 
I know this ranges off-topic a little bit, but have you looked at the book (online or hardcopy) Official Guidelines for User Interface Developers and Designers.

Note that though this link comes up with a "buy this book" page, you should check the navigation tree at left to read much of it online.


I'm not convinced that an application should be resizing form elements and text based on the screen resolution. If I upgrade from a 14" monitor at 800 x 600 to a 19" monitor at 1280 x 1024 I probably wanted more room to see more active windows, or larger windows with more text. My goal probably wasn't to see the same old thing blown up so I could sit 4 feet further away from the screen.

The same logic holds if I use the same monitor and flip resolutions.

There are vision issues. I have co-workers who run 640 x 480 on 17" and even 20" monitors due to vision impairments.


It seems to me the first thing to put effort into is making your forms resizable. Make sure that controls resize and/or float and/or stay docked to the form edges as the window gets resized.

Do everything in a base set of font sizes (labels, text, headings). Then let the user choose whether they want everything increased or decreased in size (like the setting in most browsers). Even having just a few options like 80% / 100% / 125% can be useful.

I both agree and disagree with HughLerwill. It may not be worth doing. But the idea everyone is running 1024 x 768 and up is a pipe dream. Check out one set of stats at Browser Statistics, which has a section on resolutions. 800 x 600 is still quite common.


As for the mechanics of resizing, you could just iterate through the controls collection on the form. Use a case statement, possibly on TypeName(object), to handle controls that might have a non-standard property for font size, otherwise something like:
Code:
Private Sub cmd125Pct_Click()
    Dim ctrl As Control
    
    For Each ctrl In Me.Controls
        ctrl.FontSize = 1.25 * ctrl.FontSize
    Next
End Sub
 
I agree with dilettante.

There is a lot to consider when creating a user interface. In my apps, I try not to mess with resolutions. I always write for 800 x 600. Where possible, I make multi line edit boxes, rich text boxes, (in my case a map) as large as possible given the screen resolution that the user is set for. If you can't make your text boxes fit, try adding a tab control to your form.

Dilettante makes a good argument for not messing with the resolution. I would like to extend that message by talking about colors. Do not assume your users have any particular color depth set for their display. As much as possible, leave the defaults alone. There are people out there that are color blind. You can assume that they have tweaked their windows settings to accomodate their particular challenge. By leaving the default colors alone, your app will inherit the windows default colors (stuff like buttons, forms and text colors and fonts).

And finally, if you really need to modify screen resolutions, look in to 3rd party controls. I used to use Resize. This is an OCX control. You drop it on the form and suddenly, all your controls resize.

 
dilettante,

I take on the need to cater for 'Accessibility'.

re.<<But the idea everyone is running 1024 x 768 and up is a pipe dream.>>

But nearly everyone can and should be running 1024 * 768 and up.

I took the decision to design for 1024 * 768 a couple of years ago now and have never regetted it, previously I designed for 800 * 600. We're talking here about desktop business apps in a technical environment. I took the decision after much heart rending over how new and existing users would accept it. The reaction was suprisingly positive;

1) A few had been forced to continue using old computers with small monitors for too long, they had to upgrade now and were happy to have a good excuse.
2) Most had capable equipment but many had been using it at 800*600. The advantage of using a higher screen resolution for all their applications was so revealed to them.

What I'm saying is that you should not necessarily design you application to run on any old computer. If you app does a worthwile job for the client the cost of the computer on which it runs or a new monitor may be a small consideration for him. If you allow your app to run on (really ancient)outdated equipment, it will be, performance on such kit may be poor and users (happy = good advertsing) will not thank you for it.

Lazy Sunday afternoon....
 
>nearly everyone can and should be running 1024 * 768 and up

That's an extremely arrogant view, IMHO.
 
strongm,

Sorry you think that but as long as your eyes are up to it and you have the equipment it must, surely, be an advantage to have as much room on the Windows Desktop as possible.

regards Hugh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top