11

I have developed a winform application in 1280 X 1024 pixels.....when using the same screen resolution it shown exactly...But i change my screen resolution to 800 X 600 pixels it shows screen with close button out of screen. How to fix this...is there is any restriction to build an application using a particular screen resolution basically..

Thanks in Advance....

2
  • 1
    curious why the question says this is a winform app but the tag says asp.net Mar 23, 2009 at 13:13
  • sometimes there is a restriction in the contract with your customer. than you can optimize your application for this resolution. otherwise you should support also smaller resolutions. Mar 23, 2009 at 14:22

7 Answers 7

9

1 There is no default resolution. You can observe what resolutions have your clients and take average one.

This is tip for you if you develop app for a company. Just go there and take info about it. And if you have need to design app only for one resolution - make sure that company will be ok to have all computers set to this resolution. it's in 99% not able to do, but sometimes it can be done, when your app is so specific and rare and computers are bought only for this one and only app, like netbooks.

2 How to handle different resolutions? Use Dock and Anchor properties available mostly in every these days GUI application development tools.

When you will use this, controls will naturally scale to size of a screen and your controls will no longer go behind corners of your app.

3 There is no restriction to build app for a resolution you choose.

But nowadays app I think can assume that res is min. 1024x768. And when it overlaps like you describe on 800x600 just don't bother yourself to implement fancy logic to handle this one. User will catch fast that he needs to change res to higher one.

0
2

set the form to fullscreen and the form will always be the correct size.

this.WindowState = FormWindowState.Maximized;

(is it me or is it obvious that a form of 1280x1024 doesn't fit in 800x600 screen?)

4
  • I think he's asking what size to design for
    – Chris S
    Mar 23, 2009 at 12:49
  • um, Setting a form to Maximized won't help if the form is made for an area bigger than your current resolution?
    – Svish
    Mar 23, 2009 at 13:14
  • He's asking what size he should develop for. Mar 23, 2009 at 13:15
  • He's asking 2 questions. How to fix the close button and how to design for a resolution. I answered on the first one.
    – RvdK
    Mar 23, 2009 at 13:16
2

You can work out how much "real estate" you have to design for by asking yourself who your target audience are.

  • Internal users in a company? Easy to find out the company's default screen size
  • External company. Again, ask
  • Joe Blogs on the web - design for 800x600. If that's not enough then 1024x768 is the most popular screen resolution now

Here's some display statistics for browsers which basically the same thing.

This slashdot post has lots of info, though that's 2005 and it might be even higher resolution now.

1

You have to use Anchors to each object in your layout.

This means that the layout will follow that anchor side when resizing the window. (It can ofcause be hard do downsize a window.)

1

I just wanted to add, that nowadays, we should also worry about Netbooks, that usually come with resolutions 1024*XXX where XXX is not always 768. It might be less, due to wide screens and whatnot.

1

The best way is probably to redesign your layout to support resizing: You can use the Anchor/Dock properties of controls (usually together with sub-Panels) to let your forms change the layout when they are resized. Perhaps you might also consider using a TableLayoutPanel or similar layout helpers.

If you don't want to change your layout and just need a quick fix, you could just set the AutoScroll property of your forms to True (and make them resizable by setting FormBorderStyle to Sizable, if you didn't already). Then the user can make the form smaller and still has access to all controls by using the scroll bars.

1

In fact, anchoring does not work properly if the form does not fit in the screen. It gets shrinked before the layout logic is applied, so the controls get out of form anyway. I'm searching for a proper solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.