Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How can we Center Expands the web form.

Author: DevASP
Download Source Code : 601_CenterExpand.zip

This article is about how you can grab your visitor’s attention. It centers the browser window and expands to fill the screen.

Steps you will do.

 

Start visual studio and create a new window application. Open the HTML design of your web page and before closing the head tag add the following JavaScript tag and functions.

 

 

<script language="JavaScript">

 

function expand() {

for(x = 0; x < 50; x++) {

window.moveTo(screen.availWidth * -(x - 50) / 100, screen.availHeight * -(x - 50) / 100);

window.resizeTo(screen.availWidth * x / 50, screen.availHeight * x / 50);

}

window.moveTo(0,0);

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

}

 

</script> 

 

 

Now add the following HTML code to design your web page and call the above functions

 

 

<body MS_POSITIONING="GridLayout">

<form id="Form1" method="post" runat="server">

<center>

<a href="http://www.devasp.com" onClick="expand();">Click Me</a>

</center>

<p><center>

<font face="arial, helvetica" size"-2">Dont forget to visit Devasp<br>

<a href="http://javascriptsource.com">www.devasp.com</a></font>

</center><p>

</form>

</body> 

 

 

Run your application and click on the link.

Article Comments
while loading the webForm itself i want small screen.Maximized button should be Disable.How can i make WebForm size small. i want small window

Posted on 12/13/2006 5:08:06 AM by Ancilla

Hello sir/madam,
i can center expands the webForm.but suppose i press maximized button it will maximize. i want to disable maximized button.
thank u

Posted on 12/13/2006 5:52:04 AM by Ancilla

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How you can Confirm if the user is going to Close your Browser Window.

Disclaimer - Privacy
© 2002-2017 DevASP.net