I need to see the form at design time EXACTLY as if it was maximized in run time

Posted on 2007-10-21
Last Modified: 2013-12-26
I'm using VB6, writing an application that will be run at Full Screen form size. I need to maximize the form at design time so i can layout my controls clearly. btw, double-clicking the title bar of the form only maximizes to the workspace extents (i.e., form starts BELOW the standard VB toolbars vertically), this is not what i need. I need to see the form at design time EXACTLY as if it was maximized in run time.
Thanks in advance.
Question by:maltahan
    LVL 21

    Expert Comment

    It may not be possible in my opinion. Moreover your application could run on computers with other resolutions too.

    I understand what you are  trying to do, but for that you will have to use Docking and autosize options for all your controls.

    Author Comment

    No, i've no problem with run-time operation at all, i only need to really maximize the form at design time. i think if i could just DOCK the toolbars of VB6 itself, then i could make my form maximized to the whole screen extents. because i can open and close the (toolbox), (properties) and (project explorer) panes, this enables me to horizontally maximize the form. but the problem is in the vertical maximization only. I repeat... THIS PROBLEM IS AVAILABLE ONLY AT DESIGN TIME, NOT WHEN I RUN MY APPLICATION AT ALL.

    Any real suggestions?
    LVL 23

    Expert Comment

    I'm pretty sure you aren't going to be able to do this.  The only option I can think of, and this is going to be a pain, would be to put 4 small labels (because they won't take the focus when you click on them) on your form somewhere with code to move the active control up, down, left, or right.  You can use the tab key to change which control is the active control, then when you get all the controls where you want them, another button or label with code to debug.print all the left and top properties.    So then run your app...put the controls where you want them with the 4 labels, then retrieve their coordinates, then go back to design mode and set each controls left and top property in the properties window. can put code behind every control so that you can drag them around at runtime instead of using the labels, get them where you want them, then retrieve their coordinates.
    These are both simple options, but they are a poor alternative to what you are looking for.  I'm 99 percent sure though there is no way to completely maximize the form at design time....but I've been wrong before...
    I can give you code for either of these options if by chance you are interested...
    Sorry I don't have an exact answer...

    LVL 31

    Expert Comment

    This might be silly.... but can you not just have the form be non-maximized at design time, and set its width and height to the size of your screen resolution?

    Then at runtime, set the windowstyle to maximized so it opens maximized. But at design time you can just work on it with the width and height set to the correct values for the resolution you are designing in?

    I'm pretty sure if you size a form in design mode to be larger than the screen you're working in, you will just get some scrollbars you can use to move around the form in the design window.


    Author Comment

    unfortunatly, my PC supports a max. of 1024x768 resolution, which is the same resolution for the working program.

    Anyway, the best results i had till now is with all the toolbars docked and floating, and the form is maximized at design time, this gave me about 95% of the actual run-time space, as the only missing part is that occupied with VB6 menubar and title bar.

    LVL 31

    Accepted Solution

    No, I mean at design time, have the form *not* maximized. So lets say you wanted to see how the form would look in 1024x768, set the form's width to 15360 twips and the height to 11520 twips. The effect will be that the form is the same size it would be when it is maximized (with some extra height maybe for the start menu, you can tweak around with that). Then you'll have scrollbars you can use to scroll around in the design window.

    Change the form back to maximized in the form's onload()

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now