Web Browser Popups
Hello everybody,I have created a successful webbrowser in VB Express Edition 2005, with all controls (back, forward, stop etc..). Yet when a link is clicked which opens a new window on a website, it always opens in internet explorer...
how can I prevent this from happening?
Thankyou
Ben
im only assuming here so please someone correct me if im wrong but im thinking that this may be because your default browser is internet explorer, try changing this and get back to us

Hi,
How can I change it, within my program there is no "change to default browser" button, and I have looken in Set access and defaults in windows, but nothing!!
It's not clear exactly what you want - are you saying that you want the link to open within your own webbrowser control instead of in a new window? Or are you trying to block it from opening at all?
Either way, you might look at the WebBrowser.Navigating event - you should be able to capture the URL that it is navigating to and cancel it, then if you want to open it inside your own webbrowser call the Navigate method and pass it the URL.
Or if you are saying that you want it to open in a different browser other than Internet Explorer, I don't believe that is supported.
Hope this helps,
Steve Hoag
hi,
I have this problem you said:
"you want the link to open within your own webbrowser control instead of in a new window"
I am new to this and just making the web browser as a getting started but i am having this problem how do I use the WebBrowser.Navigate event what do i need to type and where? please help!
Thanks in Advance
Luke
wb.navigate(http://microsoft.com) '<-- Navigate property
This needs to be in an executable pathway (routine, procedure, property, or method).
Does this make sense?
The event occurs asynchronously after the browser had navigated. It is not essential that you do anything in the event.
You may want to do something when the page is full loaded when correspnds to
documentcompleted event?
What goes there? Whatever processing your application needs to do when a page has fully downloaded.
In some applications that may be nothing at all.
I understand that but what I am have the problem is when a link is pressed on the web it opens in Internet Explorer, I dont put the link in for it to navigate to the webbrowser. What line of code do I need?
As you can tell im a n00b to this!
Thanks so far,
Luke.
If you simply want to block links from opening in a new window, you can use WebBrowser's NewWindow event:
Private
Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow e.Cancel =
True MsgBox("A Popup has been blocked")
End SubIf you want to capture the link and open it in your own WebBrowser instead, that's a different story.
Hope this helps,
Steve Hoag
Visual Basic Express
sorry if im confusing but
I want to capture the link and open it in your own WebBrowser please help i've already said this but i am a n00b to this
i have the same problame
please help us
thanks
Yeah I need help with this to. Please help!
OMG!!! I just solved all of our problems by logics! observe
Private Sub WebBrowser1_NewWindow(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindowe.Cancel =
TrueMsgBox(
"You are now opening a link in a new window")Dim nw As Form1nw =
New Form1nw.Show(e)
End Sub
Observe the code. The variable "e" stands for the link's URL. I simply told my application to open up a new window(nw = New Form1) and then I told it to show "e" (the links url).
it is still not working.
the link is still opening in internet explorer
please check our code.
thanks
Darn! You are right. It didn't work. I have been trying to solve this for weeks now! Somebody please help us!
Mean while... I have some nice codes that I have created.
Web Browser Title, make url show up on address bar, and progress bar...
1. Make a new textbox...name it TextPrecentage(this will be the %age of the progress of your web browser)
2. Make a new progress bar... name it ProgressBar1
3. Make sure TextBox1 is your address bar. If it is not, than change "TextBox1" to the address bars name in the following code...
Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChangedOn Error Resume NextMe.Text = "Web Browser" & " " & "[" & WebBrowser1.Document.Title & "]"ProgressBar1.Visible =
TrueTextPrecentage.Visible = TrueTextBox1.Text = WebBrowser1.Document.Url.AbsoluteUri
Dim d, t As Integerd = e.CurrentProgress
t = e.MaximumProgress
TextPrecentage.Text = (ProgressBar1.Value / ProgressBar1.Maximum) * 100 &
"%"If d <= 0 ThenProgressBar1.Value = 0
ProgressBar1.Visible =
FalseTextPrecentage.Visible =
FalseElseProgressBar1.Value = Math.Min(ProgressBar1.Maximum, Convert.ToInt32(Math.Floor(ProgressBar1.Maximum * (d / t))))
End IfEnd Sub