Solved

Auto Resize web form to fit the screen size

Posted on 2007-03-22
4
2,640 Views
Last Modified: 2011-09-20
I want a script to be included in all web pages that will automatically Adjust / Resize a web form height and width to fit the screen size..
i'm using ASP.NET 2.0 with C#
0
Comment
Question by:Collindsouza
  • 2
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
ethoths earned 500 total points
ID: 18771012
Stick this in your master page.
Note that it's not really necessary to do this on every page though. A better way would be to do it on your entry page and then detect the users attempt to resize / move the page.

<script for="window" event="onload">
  window.moveTo(0,0);
  window.resizeTo(screen.availWidth,screen.availHeight);
</script>
0
 
LVL 5

Author Comment

by:Collindsouza
ID: 18772817
Thanks for your help...
Just one more thing..
How do i enable scroll bar if the window is resized by the user??
0
 
LVL 11

Expert Comment

by:ethoths
ID: 18772938
BNot sure what you mean. The scrolbar is automatic and will appear if needed. This is unless you opened the window as js window.open and explicitly set scronlebars to none. If so just set them to auto. Full window.open syntax can be found here

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
0
 
LVL 5

Author Comment

by:Collindsouza
ID: 18772974
sorry...

The scroll bar is automatic ..

many thanks for your help...

Collin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp web application 3 36
testing a web application for ipad on windows pc 3 34
Header Font Size in Grid View 6 22
ASP.NET data base connection 35 27
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

713 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