Solved

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

Posted on 1999-01-24
10
191 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
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 1

Expert Comment

by:carlosvs
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:dgb001
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Accepted Solution

by:
israelw earned 20 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

772 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

9 Experts available now in Live!

Get 1:1 Help Now