We have users with varying screen resolution settings. For example…
Bob’s screen is set at 800 x 600
Mike’s is at 1024 x 768
Suzie’s is at 640 x 480
My app is designed for 800 x 600
How can I
a) programatically recognize their screen resolution
b) adjust the sizing of all the Windows in the app to work with that resolution
This would be specifically for those with a 640 x 480 setting (some users vision isn’t as good as most)
Thanks for any help.
Check the dimensions of the Screen object. If there are multiple monitors attached to the machine, you can iterate over them with ScreenCount and Screen(n).
Thanks Tim … now for the difficult part… any way to globally change window sizes, font settings, etc, etc … or maybe a simple resolution is to not hire people with vision issues LOL
Desktop or Web app?
Why not make windows resizable and save window bounds, so you can restore them on next launch?
You could create an array of classes to store many properties for each Screen. Ie. Available width, available height, etc. Then you would have the Screen number as your Array element # which would have all of your properties attached.
Never used it but I believe there is a product called elastic windows out there that does this for you.
I made a quick little demo to show you how to capture the screens in an array along with forming a property class for each along the way. Once you have the screen information in a good format you can do what ever you want to the windows/container controls.
My Screen 0 is my 15 inch MBP and my Screen 1 is a 27" iMac
Can you give some more examples of Screen Sizing and how big you want the window to be for test?
ie. 1440 x 900 --> Window should be (w)600 (h)900 or something like that. Do you have this in mind?
When debugging this you can see the following:
My Array of Screens (I have two Screens)
Peering into Array Entry # 0 I see my first screens worth of “Info” (My 15" Mac Book Pro)
Array Entry #1 (My Second Monitor 27" iMac)
Elastic window won’t help as it would shrink everything to fit. The problem here is you will need to rearrange the layout to accomodate different sizes, especially as the lower resolution implies that everything needs to be bigger (otherwise, you defeat the purpose).
In the past I’ve created some projects using different window sizes. Application’s main window is set to “None”, and in the app.open event, the screen.width and screen.heigth results determine which window will be used as main window in the first place. Also I’ve added some menu items to let the user select another window size, as long as it fits into the screen.
i have use elastic window and i have a screen setup window with some common screen resolution. i use percentage on the screen setup and save the information to a config file sitting next to the program. when i open the application, i check what is the percentage, anything between -15 to +75. Tim is right about shrink everything to fit but most of the time for my client, it is sizing up from my default windows size which 1024x768
Hi Detlef, Can you please advise how to call the window to be used in first place. I was able to calculate the screen size however i get error when opening a window, while my other window is hidden. Also i don’t see a none selection on windows.
I am okay with the screen resolution calculation, just i am not able to figure out how to initialise a window from multiple windows.