Open webbrowser with specific url in WP7

▼魔方 西西 提交于 2019-12-22 12:15:57

问题


How would i go about opening the webbrowser with a specific url on button click.


回答1:


Put the following code in the button Click event handler:

var task = new Microsoft.Phone.Tasks.WebBrowserTask
            {
        URL = uri
            };

            task.Show();



回答2:


with this code on button handler event you can navigate to the url assigned to var URL

        WebBrowserTask wbTask = new WebBrowserTask();
        var URL = "http://create.msdn.com";
        wbTask.Uri = new Uri(URL, UriKind.RelativeOrAbsolute);
        wbTask.Show();


来源:https://stackoverflow.com/questions/6585513/open-webbrowser-with-specific-url-in-wp7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!