简体   繁体   中英

How to increase or decrease web browser control font size using button?

Hi i am using web browser control.I have two button increase and decrease.I want to increase or decrease web view content

My xaml code

<phone:WebBrowser x:Name="Webbrowser" IsScriptEnabled="True"/>

My xaml.cs code

private void zoom_out(object sender, RoutedEventArgs e)
    {
        if (j > 0)
        {
            Webbrowser.FontSize -= 2;

            j--;
            i = j;
        }
    }
    private void zoom_in(object sender, RoutedEventArgs e)
    {
        if (i < 3)
        {
            Webbrowser.FontSize += 2;

            i++;
            j = i;
        }
    }

I tried this code but i cant increase or decrease web view font size.i am struggling long time.please help me any one

Based on your scenario FontSize of the WebBrower control wont work as you need to set the FotnSize for the content which is rendered from the html page. Hence you may try ScaleTransform in WebBrowser.RenderTransform option to achieve this. I think it may help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM