Resizing windows

If you have a lot of data on an entity form, then you sometimes do want to force the page to open in full screen mode. There's a small javascript which will allow you to do this. Just add these two lines of code to the form onload of your entity form:

window.resizeTo(screen.availWidth, screen.availHeight);

Also, when you open a custom page you can also set the window size by using the same javascript function. In your code you can use the following function in the Page.OnLoad() to set the window size to match your requirements:

private void SetWindowSize(int iWidth, int iHeight)
StringBuilder sbResizeScript = new StringBuilder();
ClientScript.RegisterClientScriptBlock(this.GetType(), "ResizeScript", sbResizeScript.ToString());

Happy resizing!


Anonymous said...

ping back from

raggers said...

Thanks for the script.It helped us to resize the window .Great , keep it up

Unknown said...

This is not working from outlook client.