system.windows.forms.webbrowser open link same window

PROKA

Junior Contributor
Joined
Sep 3, 2003
Messages
249
Location
Bucharest
The title says it all. I'm using a system.windows.forms.webbrowser control and I am allowing navigation, but if a link tries to open in a new window, it should open in the same (in the webbrowser from my program). How can I accomplish that?
 
For starters, look at the NewWindow event. I believe that it is raised (and allows you to cancel) if any kind of popup is going to be shown. As far as intercepting the url to navigate to, I can't help you with that.
 
If I'm not wrong there's an event raised when a link is clicked. Process that event yourself and cancel the default action... worked fine for me (in win32)...
 
OK I managed somehow to take the link out of the activeElement. The problem is there are a lot of ways to open a new browser window: like html link or javascript function or etc etc
 
Back
Top