Discussion:
Override TargetFrameName in VB 2008 WebBrowser Control
(too old to reply)
SunBum
2011-08-04 17:18:31 UTC
Permalink
Hey All,

I have a test app in Visual Basic 2008 that has a Webbrowser control.

I am pulling in random pages into my control and many have images that
are hyperlinks to other sites.

I am trying to FORCE when any of these linked images are clicked to be
target _blank so they will open in a new browser and NOT in my
webbrowser control.

Looking for any method to do so. I believe the key is in the navigate
property but am a real newbie to VB.

Thanks for any help!

Mike
Mayayana
2011-08-04 18:23:33 UTC
Permalink
This group is mainly for VB 5/6. VB is entirely
different from VB.Net, despite the fact that Microsoft
has taken to calling VB.Net VB. The group you want
is here:

microsoft.public.dotnet.languages.vb

Note that MS has stopped supporting their own
newsgroups, but most newsreaders can still get them
and the groups are still active.

The only thing that MS now supports is web forums.
The forums don't work very well, they're monitored
and controlled by MS employees or fans, and you have
to get a "Live ID" to take part, but they may be more
busy than the usenet groups. Those are here:

http://social.microsoft.com/Forums/en-US/categories
http://social.technet.microsoft.com/forums/en-US/categories/
http://social.msdn.microsoft.com/Forums/en/categories/

As for your question, what you need to know about is the
IE DOM, not VB or VB.Net. In the VB WB control there is
access to the document object as a property of the WB.
That gives you access to elements, events, etc. In VB the
method would be to declare in the form with the WB:

Private WithEvents Doc As HTMLDocument

Then in Sub WB_DocumentComplete you would have
something like this:

Set Doc = Nothing
If Not WB.Document Is Nothing Then Set Doc = WB.Document

That way you always have the current document.
Hopefully .Net is capable of something similar.

|
| I have a test app in Visual Basic 2008 that has a Webbrowser control.
|
| I am pulling in random pages into my control and many have images that
| are hyperlinks to other sites.
|
| I am trying to FORCE when any of these linked images are clicked to be
| target _blank so they will open in a new browser and NOT in my
| webbrowser control.
|
| Looking for any method to do so. I believe the key is in the navigate
| property but am a real newbie to VB.
|
| Thanks for any help!
|
| Mike

Loading...