Mo

Mo

  • NA
  • 15
  • 0

webbrowser question

Jun 9 2010 12:12 PM

Hi,
I am new to Windows forms and this is the first one I am doing.
I have a form (Form1) with a set of links/button. In another form (Form2), there is a webbrowser control. I am trying to navigate to a given url when a button is clicked in Form1. I traced the code and when I click a link the url is set properly and I set webbrowser's navigate property but it stays in form1 and does not display anything.
Form 1:
Button1 with onClick event.
Form 2 (the class is called "Link"):
WebBrowser control (wbLink). I added a public method:
public void setUrl(string sUrl) {
wbLink.Navigate(sUrl); }
In Form1, there is a onClick event for the button:
Link link = new Link();
link.setUrl(http://blahblah.com)
What am I missing?

Answers (1)