is there any way to change the size of an HTA application?
thanks
<script type="text/javascript">
window.resizeTo(300,290);
</script>
Javascript and VBScript ways to size the HTA on loading, to 1/4 the screen area (half the height, half the width) and center it - using screen.availWidth
and screen.availHeight
:
<SCRIPT LANGUAGE="javascript">
function Window_onLoad(){ // resize to quarter of screen area, centered
window.resizeTo(screen.availWidth/2,screen.availHeight/2);
window.moveTo(screen.availWidth/4,screen.availHeight/4);
}
window.onload=Window_onLoad;
</SCRIPT>
In VBSScript a Window_onLoad
sub will automatically get called any time the HTA starts up (or is refreshed) :
...
</head>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
' resize to quarter of screen area, centered
window.resizeTo screen.availWidth/2,screen.availHeight/2
window.moveTo screen.availWidth/4,screen.availHeight/4
End Sub
</SCRIPT>
<BODY>
...
I've just tested it (Win XP on an old laptop) and there's a quick flicker of the initial larger window before it shrinks to the smaller size, but it's not that bad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With