Resizing a HTML application

  • Thread starter Thread starter Oriane
  • Start date Start date
O

Oriane

Hi there,

I would like to resize an HTA window which launches a Asp.Net page with
parameters coming from Profile object.
I get something like, in my HTA file:
<HTML>
<HEAD>
<TITLE>Stibil</TITLE>
<HTA:APPLICATION ID="Stibil" >
<SCRIPT TYPE="text/Javascript">
window.resizeTo(300,290);
</SCRIPT>
</HEAD>
<BODY>
<IFRAME SRC="http://localhost:100/default.aspx"
STYLE="width:100%;height:100%"></IFRAME>
</BODY>
</HTML>

But instead of passing hard coded parameters (300, 390) , I would like to
pass parameters coming from my profile Asp.Net database.

Any idea ?

Oriane
 
Another way would be to "autoresize" my HTA. I mean: when I shrink manually
my window, scrollbars appear when the HTML content cannot be fully visible.
So my HTA "knows" the size of the HTML content and therefore I should be
able to get this knowledge to resize the HTA.
 
Finally, I use that code:

<HTML>
<HEAD>
<TITLE>Zapette Stibil</TITLE>
<HTA:APPLICATION ID="Stibil">
<SCRIPT TYPE="text/Javascript">
function resize() {
var as = document.getElementById("frame");
this.window.top.resizeTo(as.offsetWidth, as.offsetHeight);
}
</SCRIPT>
</HEAD>
<BODY onload="resize()" >
<IFRAME SRC="http://localhost/default.aspx" id="frame" APPLICATION="No"
STYLE="width:100%;height:100%;" MARGINWIDTH="0" MARGINHEIGTH="0"
HSPACE="0">
</IFRAME>

</BODY>
</HTML>

And it works...
 
Hi Oriane,

Glad to know you've solved this problem by yourself and thanks for sharing
the solution with us.

Have a nice day!
Allen Chen
Microsoft Online Community Support
 
Hi Allen,
Allen Chen said:
Hi Oriane,

Glad to know you've solved this problem by yourself and thanks for sharing
the solution with us.

Have a nice day!
Unfortunaltely, there is still a small problem. The resizeTo resizes the
WHOLE window. Depending on if the user has several toolbars, the status bar,
and any other optional window goodies that make the window an indeterminate
size, I can not guarantee that the resize() method will meet my needs.

So do you have a workaround ?

Cheers
 
Hi Oriane,

I'd like to help. However I'm not sure whether my understanding to your
requirement is correct. Do you want to adjust the size of the iframe to let
it accommodate the content page in it? Something like this?

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">

function Test()
{
var f=document.getElementById('frame');


f.height=f.contentWindow.document.body.scrollHeight;
f.width=f.contentWindow.document.body.scrollWidth;
}

</script>
</head>
<body onload="Test()">
<form id="form1" runat="server">


<IFRAME id="frame" SRC="http://localhost/Default.aspx"/>

</form>
</body>

</html>

If my understanding is wrong could you tell me what the effect is that you
want to achieve?

Regards,
Allen Chen
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Allen Chen said:
Hi Oriane,

I'd like to help. However I'm not sure whether my understanding to your
requirement is correct.

Yes I've changed my needs. For now, I only want to resize a simple html (in
fact an asp.net) page, but the ResizeTo method doesn't meet my requirement,
since it resizes the outer window but not the inner (the "payload" content)
area.

So I don't have frame any more...

Thanks for your answer...
 
Hi Oriane,

If you want to zoom the content you can try following JavaScript:

document.body.style.zoom = '50%';

If it's not what you need please clarify your requirement. You may send me
some pictures to clarify it. My email is (e-mail address removed). Please
update here after sending the project in case I missed that email.

Regards,
Allen Chen
Microsoft Online Community Support
 
Hi Oriane,

Great. Thanks for your sharing.

Have a nice day!

Regards,
Allen Chen
Microsoft Online Support
 
Back
Top