DelphiFAQ Home Search:

Obtain screen and current window size in VBScript

 

comments4 comments. Current rating: 4 stars (2 votes). Leave comments and/ or rate it.

Question:

I want to adjust my web page's controls to the browser window size. How can I find the size of the browser's window?

Answer:

VBScript has the screen variable with properties height and width. Use document.body.clientWidth and document.body.clientHeight for the viewable size.

<script language="VBScript">
<!--
document.write ("<p>VBScript is enabled and working.<p>")
document.write "Your screen width is : " & screen.width & " pixels<br>"
document.write "Your screen height is : " & screen.height & " pixels<br>"
document.write "Your viewable Width is : " & document.body.clientWidth 
document.write " pixels<br>"
document.write "Your viewable Height is : " & document.body.clientHeight 
document.write " pixels<br>"
-->
</script>

Comments:

2006-07-25, 08:18:51
anonymous from United States  
rating
Thanks for the help!
Looking for this exact code.
2007-04-09, 00:30:39
anonymous from India  
rating
need more details

Keywords: vbscript object model

2007-04-23, 11:11:09
anonymous from United States  
Gentlemen:
I believe that it stinks...the fact that you have taken you telephone number away from your custmers viewing...can find help/customer service numbers anywhere anymore! What do you have to say about that...additionally, why do I NEVER receive any answers when I try to communicate with you via Email??? Sure would be nice to receive a meaningful answer to this one...or would you rather continue doing nothing to assist your customers...like me, a five year customer! cajim1@msn.com

Jim Huddleston, April 23, 2007
2008-02-28, 17:51:46
from Italy  
DDDDDD

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Washington, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
Leave your comment here:
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.