Link to home
Start Free TrialLog in
Avatar of BigOldDog
BigOldDog

asked on

I need a form wider than my screen in VB 2010

I am writing a VB2010 program on a desktop computer with a 1280 X 1024 screen, but the program will run on a laptop with a 1900 X 900 screen.
I can enter 1900,900 in the forms max size property but the size property will not accept a width above 1300.
I need to place controls in the part of the form beyond 1300 in the designer window.
I have tried to change my screen resolution but 1280 X 1024 is as high as it will go.

Any suggestions (apart from buy a new screen)
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

You can't. It is stated clearly in the online documentation for the framework that the limit is the resolution of the screen on which the application runs (not the screen where it is designed). Even if you set it in the code, its reset at runtime.

I have a few solutions for you.

Buy a new monitor. The cost of decent 1920x1080 monitors is now around 150$ at Staples in Canada, thus probably lower in the states. If you count the cost of your time to use any of the other solutions, that is a steal. And since these types of definitions are now quite standard, expect to have other request like that one. Save yourself the trouble.

Create a resizable form. This is done through the Anchor property of the controls. You need to get used to the mechanism before you are comfortable with it, but it works quite well. You can design on your maximum definition, but the form will adjust itself if it is resized. You will find a lot of articles on how to use Anchor if you search for "Windows Form Anchor". This would be my preferred solution if buying another monitor is completely out of the question for you. You would not be stuck if the user eventually goes for a better screen or if the application needs to be run on another computer that does not have the 1900 resolution.

Some programmers put a Panel on a Form that has the AutotoScroll and AutoSize. They would set the Panel at the proper resolution, and then use the scroll bars on the form to design their thing. A Me.Width=1900 in the Form_Load event will enable the form to show correctly on your users's computer. But you will be stuck with the scrollbars when testing on yours and if the user tries to run on a lower definition computer.

Develop the application as a WPF Windows application. WPF has been designed for resizing, and will prepare you for eventual development on a mobile or a tablet environment, since the concepts it uses are the only one available to create screens in the new Windows 8 interface. The main problem here is that in order to facilitate the adaptation of the application to various screens and orientations WPF does not leave you has much possibilities as a Windows Form. It can be hard to use for very complex forms. And the learning curve is to consider.
ASKER CERTIFIED SOLUTION
Avatar of BigOldDog
BigOldDog

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BigOldDog
BigOldDog

ASKER

The only solution offered was specifically excluded in the question. And the solution was so obvious I should not have asked the question in the first place