Click here to Skip to main content
15,851,242 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hello i want to set Webpage zoom level 90% to programmatically in C#.
Posted
Comments
[no name] 6-Oct-14 8:57am    
You do some research such as http://www.bing.com/search?q=c%23+zoom+web+page and then you write some code.
Sergey Alexandrovich Kryukov 6-Oct-14 10:17am    
Why? It makes no sense, because of different devices people would use on the client side.
—SA

1 solution

The Firefox & Chrome (Webkit) equivalents to the IE-specific zoom property are, respectively, -moz-transform and -webkit-transform.

sample code :
CSS
.zoomed-element {
    zoom: 1.8;
    -moz-transform: scale(1.8);
    -webkit-transform: scale(1.8);
}


You'd have to be a bit more careful with Javascript (test for existence first), but here's how you'd manipulate them:
JavaScript
el.style.zoom = 1.9;
el.style.MozTransform = 'scale(1.9)';
el.style.WebkitTransform = 'scale(1.9)';


Read here http://stackoverflow.com/questions/16836167/c-sharp-or-javascript-set-window-zoom-on-100[^]

http://msdn.microsoft.com/en-us/library/ms531189%28v=vs.85%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900