• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

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

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
dgb001
Asked:
dgb001
  • 4
  • 2
  • 2
  • +2
1 Solution
 
carlosvsCommented:
Do you need to change the form size for different Screen Resolutions.....

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

0
 
dgb001Author Commented:
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
 
mark2150Commented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dgb001Author Commented:
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
 
amebaCommented:
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
 
israelwCommented:
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
 
dgb001Author Commented:
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
 
israelwCommented:
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
 
mark2150Commented:
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
 
dgb001Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now