Click here to Skip to main content
15,877,966 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I m using VS2012. I have created an application in visual basic (windows store application).
but the problem is when i run that application in high resolution the content becomes smaller..
i want to know how to resize content according to resolutions..
Sergey Alexandrovich Kryukov 10-Oct-12 13:21pm    
Why? Don't you think that the application should look relatively smaller? For most users, this is so.

1 solution

There can be different answers. It depends on the purpose of the application and one very basic thing: if you need the main application windows resizeable or not.

In most simple case, you don't need to do anything. Just think why a user buys a bigger monitor. To start with, let's consider a simple fixed-size (in pixels) window. What you describe is close to the following situation: let's say, your application takes a quarter of screen on some small monitor. How can it end up in a bigger one? The user might buy a bigger monitor, and, typically, the pixel size on this monitor is not much bigger, if its is bigger at all — it can be even smaller as technology improves.. It just has more pixels. This way, your application becomes smaller in absolute sized (number of pixels is the same), or only relatively: now it does not take a quarter of the screen, but it may take even 1/16 of it.

If you think that the user wants the application to take the same quarter-size of the monitor, in absolute majority of questions, you are wrong. The user would want to have it small, to show more application in the same screen. In other words, the user really needs to see the total number of features at once, compared to the old monitor.

Anyway, if you want to resize the window so it would take the same part of the screen, you can always do it, because you can always get the screen size. In WPF, you would use System.Windows.SystemParameters.PrimaryScreenWidth and System.Windows.SystemParameters.PrimaryScreenHeight, in Forms — the class System.Windows.Forms. By why? You should also understand that different monitors have different aspect ratios. Well, I must admit there are some rare cases when such approach makes sense. Rarely, though.

Now, it's a good idea to make the application resizeable, so the user decides on the convenient size of it, or maximize. It pays of especially well if you provide more and more detail viewable at once as the window grow. The window layout should be fluid. You need to design the application layouts nicely, so it will work well for a wide range of sizes. It means, no absolute positioning, no assumption of font size, everything is resized automatically. For more detail, please see my past answers:
Zom Out malfunctions when Screen resolution changes[^],
GUI Apperance - C#.Net[^],
how to dock button so that it can adjust with the form[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900