-
Feb 21st, 2012, 12:05 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] hyperlink in code vb.net silverlight 2010
Hello,
I was looking for how to simply use the browser of the phone to jump to a link from my application.
I found what seems to be used in c# which looks reasonable:
http://forums.silverlight.net/t/163160.aspx/1
Code:
System.Windows.Browser.HtmlPage.Window.Navigate(FullNaviagteURI)
I just want to know how to do this in VB.net, the reason I am not using a hyperlinkButton is because I am binding some titles and they don't fit on one line and the hyperlinkButton cannot wrap text so I need to do this on tap in code
Please advise
-
Feb 22nd, 2012, 09:37 AM
#2
Re: hyperlink in code vb.net silverlight 2010
Wrapping style for a hyperlink button: http://www.pitorque.de/MisterGoodcat...ton-style.aspx
Here's the C# code translated
Code:
Private Sub Button_Click(sender As Object, e As RoutedEventArgs) Handles Button.Click
Dim url As New Uri(TryCast(sender, Button).Tag.ToString(), UriKind.Absolute)
HtmlPage.Window.Navigate(url, "_blank")
End Sub
I would recommend creating the 1st option myself.
-
Feb 22nd, 2012, 11:00 AM
#3
Thread Starter
Fanatic Member
Re: hyperlink in code vb.net silverlight 2010
Hi, thanks for reply
I get this error:
'HtmlPage' is not declared. It may be inaccessible due to its protection level.
HtmlPage comes from System.Windows.Browser as I found in the msdn documentation, but I don't seem to have it in the references list. I also forgot to mention this is Windows Phone app using Visual Studio for Windows Phone if that makes any difference.
-
Feb 22nd, 2012, 11:07 AM
#4
Thread Starter
Fanatic Member
Re: hyperlink in code vb.net silverlight 2010
Hi again,
I actually just discovered this code that works ! :
Code:
WebBrowserTask task = new WebBrowserTask();
task.URL = "http://www.stackoverflow.com";
task.Show();
Thanks for help, resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|