Hi all,

I have a webbrowser control on my VB.net form. When a URL naviagtes to another window, I want to do it in same window. i.e. WebBrowser contol should not open a new Window & navigate to the new url in same window.

I have achieved preventing the it a new window by using e.Cancel = True
Now how to naviagte to the new URL in same window?

In the NewWindow event of the browser control, you can use the following code:

e.Cancel = True
WebBrowser1.Navigate(New URI(DirectCast(sender, WebBrowser).StatusText))

This will force the active web browser to navigate to the clicked item.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.