Solved

Auto Resize web form to fit the screen size

Posted on 2007-03-22
4
2,526 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now