[Windows Phone] Web Browsing Control (WebBrowser)

This article demonstrates how to use the WebBrowser control in a Windows Phone application, and use the Navigate and WebBrowserTask methods to specify web pages and browse web pages.

Preface

This article demonstrates how to use the WebBrowser control in a Windows Phone application, and use the Navigate and WebBrowserTask methods to specify web pages and browse web pages.

Practice

step1 Create a project

Share a picture

step2 screen design

share picture

Button control: Name = btn1, Content = UU’s blog

Button control: Name = btn2, Cintent = Google

WebBrowser control: Name = wb

 












step3 btn1_Cli ck event:

private void btn1_Click(object sender, RoutedEventArgs e)

{

wb.Navigate (new Uri("http://www.dotblogs.com.tw/uvia820701/", UriKind.Absolute));
}

step4 btn2_Click event:

private void btn2_Click(object sender, RoutedEventArgs e)

{
WebBrowserTask wbTask = new WebBrowserTask();
wbTask.Uri = new Uri("https://www.google.com.tw/", UriKind.Absolute);
wbTask.Show();
}

Result

When you press the [UU’s blog] button, the WebBrowsew control will display the blog’s website, and when you press the [Google] button, it will jump out of Google’s Web page.

Share a picture??? ?Share a picture

Note

Since the network and WebBrower controls are used, Please refer to the figure below to enable the function.

share picture

Sample file

WebBrowser.rar

Related references and links

WebBrowser control for Windows Phone

Original text: Large column [Windows Phone] WebBrowser control (WebBrowser)

Leave a Comment

Your email address will not be published.