Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Auto Resize web form to fit the screen size

Posted on 2007-03-22
4
Medium Priority
?
2,832 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
ethoths earned 2000 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

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 …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

670 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