Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

-------- HANDLING SCREEN RESOLUTIONS --------

Posted on 1999-01-24
10
Medium Priority
?
200 Views
Last Modified: 2013-11-25
Finally had enough of trying to get a decent third party tool to do the job for me, so does anyone have any good code for handling control resizing for different screen resolutions. I tried all sorts of third party tools, notably Larcom and Youngs, which works fine in development - but thats about all. I cant believe it's so difficult to find a way to do it. Any offers appreciated, any code gratefully recieved. Sorry, not many points - I'm running low.
Thanks in advance,
Dave

0
Comment
Question by:dgb001
[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
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 1

Expert Comment

by:carlosvs
ID: 1470426
Do you need to change the form size for different Screen Resolutions.....

use screen control..
Me.Height = Screen.Height
Me.Width = Screen.Width

0
 
LVL 1

Author Comment

by:dgb001
ID: 1470427
Well, pretty much any control in the forms and the forms also - ie. you can design your program to look fine in 800*640 resolution but run the same program in 640*400 (or whatever it is) and it'll look like something a mental patient designed. I need something that will act in the form.resize procedure to handle the resizing of the controls and then of course the fonts too, etc, etc, etc. But thanks for your comment anyway.
Dave
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1470428
Been a lot of discussion on this topic. General consensus is that you *SHOULD NOT* adjust your app to grow proportionally as scree rez changes. This defeats the purpose of going to a higher rez for the user and is perceived as a *BUG*. If I bump up my rez, I want your app to take *LESS* on screen real estate - NOT MORE!

Design your app to look clean at the lowest res you want to support and let it *stay* that size.

M

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:dgb001
ID: 1470429
Thanks Mark, as always a useful comment. Thing is that I designed it at 800*640, which I imagine is most people's default rez, but it looks terrible in low or high rez. Yes, as you say in high rez then it should take up less of the playing field, which is fine by me, but the way Windows "automatically" decides how to adjust the postion of various controls leaves me freaking out - I don't mind having a smaller area of screen, (or larger in low rez) but I still want to have the controls in postions relative to where I created them. I thought of checking for screem rez on program start up and then asking the user if they want to have it changed, or to not continue if they don't - but it doesn't look very professional does it. Any other ideas from you welcome. Thanks, Dave.

0
 
LVL 15

Expert Comment

by:ameba
ID: 1470430
I agree with mark2150 (M, I see you will be soon in 'Top 14' area, congrats)

dgb001, to see more arguments *not* to use resizers see
http://www.experts-exchange.com/Q.10102939 (18 points)

0
 

Accepted Solution

by:
israelw earned 60 total points
ID: 1470431
Hello dgb001!

Here I Mean To give you answer about your question.

But i want to tell you this answer equal more than 25 points (joke).

you two options:
1. using the screen object with height and width properties.
   or if you want to make adjustment to the taskbar you have to    use the scaleheight and scalewidth properties.

now you have the second option and the favorite.
this option is a proffesional solution to this problem and it will response even if the user make resulution change within the program is run.

steps:
1. in project menu goto components.
2. add the microsoft sysinfo component. (if you dont have this    control just gain the SYSINFO.OCX file )
3. add the sysinfo control to your form
4. click on code window and navigate to the event
   SysInfo1_DisplayChanged. then write the next code in the    procedure

5. If Screen.ActiveForm.Width > SysInfo1.WorkAreaWidth Then
      Screen.ActiveForm.Left = SysInfo1.WorkAreaLeft
      Screen.ActiveForm.Width = SysInfo1.WorkAreaWidth
   End If
   If Screen.ActiveForm.Height > SysInfo1.WorkAreaHeight Then
      Screen.ActiveForm.Top = SysInfo1.WorkAreaTop
      Screen.ActiveForm.Height = SysInfo1.WorkAreaHeight
   End If

6. In Your FormResize Event Write The Correct Code To Resize    Your Controls On The Form.
   Using the scaleheight and  scalewidth properties.

7. just give a response to my answer.

Thanks Ahead
israelw.
0
 
LVL 1

Author Comment

by:dgb001
ID: 1470432
Wow, lots of comments - thankyou ameba for your latest - I'll take a look at the Q you suggested. Meanwhile, israelw, that looks like something I could find useful but I'll need to wait until tonight before I can play with it. Can you give a bit of an idea abot scaleheight and scalewidth though, I've never actually used those before - yes, I know this is worth more than 25 points, sorry.
Thanks again,
Dave

0
 

Expert Comment

by:israelw
ID: 1470433
Hi Dave!

First, I Need To Tell You That The Screen Object Dosen't Support
the scal's properties but the form object have them.
the scal's properties give you the height and width that you have for your control on the form.
that mean if you have some control i.e. textbox on your form and you want to add anothe label on your space on the form how can you know how space there is on your form?
the scal's properties calculate this and return the NET space on the form

thanks ahead
israelw.

p.s. Sorry,Sorry about my poor english  i'm not american.


0
 
LVL 12

Expert Comment

by:mark2150
ID: 1470434
You'll find that the controls can be easily scaled, you get into trouble with fonts. There is no metrical relationship between font size and screen size. Additionally the variations of face (bold, ital, roman, etc.) impact the space required. Although you can fairly easily resize the controls, the text will be problematic.

M

0
 
LVL 1

Author Comment

by:dgb001
ID: 1470435
Ok israelw, I can understand what you're saying - I actually found some other code also which is proving of use, but I can see that your theory is pretty sound. Mark is right about fonts, but I actually already coded to handle that so when I was playing with some third party controls which didn't work, but yes that would be a problem without adding additional code to handle fonts as well as just resizing controls. Well, thanks everyone for their comments, and thanks again israel (I'm not American either, I'm English, though I work in America, but your English is very reasonable).
Dave
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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