如何在 Visual C# 或 JavaScript 中以编程方式放大 WebBrowser 控件中的网页?
这是我的尝试:
if (window.screen.width=='600')
{
document.write ('<body bgcolor="#4FB8CB" style="zoom: 55%">')
;}
else if
(window.screen.width=='800')
{
document.write ('<body bgcolor="#4FB8CB" style="zoom: 75%">')
;}
else if
(window.screen.width=='1024')
{
document.write ('<body bgcolor="#4FB8CB" style="zoom: 100%">')
;}
else if
(window.screen.width=='1152')
{
document.write ('<body bgcolor="#4FB8CB" style="zoom: 110%">')
;}
else if
(window.screen.width=='1280')
{
document.write('<body bgcolor="#4FB8CB" style="zoom: 127%">')
;}
else if
(window.screen.width=='1600')
{
document.write('<body bgcolor="#4FB8CB" style="zoom: 155%">')
;}