HTA,如何以编程方式调整窗口中的所有元素,同时将其放在需要的桌面上

问题描述 投票:1回答:1

我读过这个highly useful post,遗憾的是我没有解决我的问题:如何在HTA文件中使用HTA中的代码缩小(缩小)窗口,文本和框的全部内容?我正在使用IE11(或者它使用我),每次打开它时我都需要按Ctrl-Scroll缩小窗口内容的大小。

现在,我按照评论中的建议添加了meta http-equiv =“x-ua-compatible”content =“ie = edge”,但是现在它打破了文件在位置1920,0的位置。有没有一个解决方案可以调整大小并允许我将窗口放在我需要的地方?

<html><title>A Form </title> 
<meta http-equiv="x-ua-compatible" content="ie=edge" />.
<body style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#C0CFE2', startColorstr='#365ebf', gradientType='0');"> 
<head>

<script language="JavaScript">window.resizeTo(320,1080);</script> 
<style type="text/css"> 
body { 
 transform: scale(0.9);
 height: 90%; 
 background-color: #EFEFDC; 
 font-family: Arial Narrow; 
 font-size: 12px; 
 color: #343421; 
 margin: 2px;  
filter: none !important; 
} 

b { 
 font-size: 16px; 
 padding: 1en; 
} 

</style>

<SCRIPT Language="VBScript">
    Sub Window_Onload
        window.moveTo 1920, 0
    End Sub
</SCRIPT>
windows internet-explorer-11 hta
1个回答
1
投票

我重读了你的问题和你的意见,我想我更了解你的要求。要以编程方式增加所有控件的缩放级别,请使用类似于:

<script>
document.body.style.zoom = "200%"
</script>

随意在任何地方添加此代码,我在脚本体的末尾尝试了它,它对我有用:

<html>
<head>
<title>A Form</title>
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<style>
html {
    height: 100%;
}
body {
    -ms-zoom: 0.50;
    background-image: linear-gradient(135deg, #C0CFE2, #365ebf);
}
</style>
</head>

<body>

What is your name?<p>

<input id="name" value="Luke"></input><p>

<input type="button" value="CLICK ME" onclick="alert('Obi-Wan says: Use the Force, ' + document.getElementById('name').value + '.')"><p>

</body>
<script>
  window.moveTo(100, 300);
  window.resizeTo(500, 300);
</script>

<script>
document.body.style.zoom = "200%"
</script>

</html>

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.