Maximize Form on Form Load

     Yesterday at 02:31 PM   #1

Hi guys, 


I try to maximize the form during form load.
this is the jscript that i used on v7.6
var mainDoc = document;
var Loaded = false;
var curCursor = "default";
var bWaiting = false;
var lastButtonClicked = null;
var updateTimeout = null;
var canSubmitID = null;
var arFrameWindows = new Array();
var bTabbing = false;
function Maximize()
{
top.window.moveTo(0,0);
if (document.all)
   { top.window.resizeTo(screen.availWidth,screen.availHeight); }
else if
   (document.layers || document.getElementById)
   {
   if
    (top.window.outerHeight < screen.availHeight || top.window.outerWidth <
screen.availWidth)
     { top.window.outerHeight = top.screen.availHeight;
       top.window.outerWidth = top.screen.availWidth; }
   }
}
anyone can guide me on v9?
thanks
Tagged:

Comments

  • Hi Chun

     

    Try to delay the execution for half a second, like this:

     

    function MaximiseForm()
    {
        window.setTimeout(
            function()
            {
                top.window.moveTo(0,0);
                if (document.all) 
                {
                    top.window.resizeTo(screen.availWidth,screen.availHeight);
                }
                else if (document.layers||document.getElementById) 
                {
                    if (top.window.outerHeight < screen.availHeight||top.window.outerWidth < screen.availWidth)
                    {
                        top.window.outerHeight = screen.availHeight;
                        top.window.outerWidth = screen.availWidth;
                    }
                } 
            }, 
            500);
    }
    

     

    The above works for me in 9.1.1

     

    iain

  • Thanks! it works for me.

  • This is only workaround. But it would be nice to have some client side property to check if all form is loaded and initialize for this purpose.