2 Replies - 819 Views - Last Post: 20 August 2013 - 10:48 PM Rate Topic: -----

#1 ejrod31  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-August 13

Web browser opening url from a Dim statement

Posted 20 August 2013 - 09:15 PM

I am fairly new to vb.net but I have some sence of it. I have been trying to get a web browser to display a Url from a Dim.
I have tried
Dim url as String = "http://youtube.com"
WebBrowser1.URL = Me.url
' and i have also tried
WebBrowser1.Navigate = Me.url
' and also
WebBrowser1.document.Url = Me.url


I keep getting the error "String can not be converted to System.uri"

Is This A Good Question/Topic? 0
  • +

Replies To: Web browser opening url from a Dim statement

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9096
  • View blog
  • Posts: 34,168
  • Joined: 12-June 08

Re: Web browser opening url from a Dim statement

Posted 20 August 2013 - 09:20 PM

Then give it what it is asking for - a system.uri object! Conveniently enough the system.uri constructor takes a string.

http://msdn.microsof...system.uri.aspx
Was This Post Helpful? 0
  • +
  • -

#3 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Web browser opening url from a Dim statement

Posted 20 August 2013 - 10:48 PM

View Postejrod31, on 20 August 2013 - 10:15 PM, said:

I have tried
   Dim url as String = "http://youtube.com"
   WebBrowser1.Navigate = Me.url


This would have worked had you used it properly. .Navigate takes a string, but not with an "=" sign.

        Dim url As String = "http://www.youtube.com"
        WebBrowser1.Navigate(url)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1