Results 1 to 7 of 7

Thread: .Net WebBrowser

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    9

    .Net WebBrowser

    Hi all, I seem to have found a little flaw in .Net WebBrowser and myself i cant seem to work around it. Basically, If you use the WebBrowser from the toolbox (C#/VB.Net/C++.Net), code what you want etc etc. Then if you goto a page that normally when you click a link, it will open a new browser window, the .Net WebBrowser seems to start IE. Now i know this is based on what ever version of web browser you have, but thats not my point. My current point is that the event handler of WebBrowser called "NewWindow" doesnt contain the URL of the new window being loaded. Now being the .Net there is always 2 ways to do something, so i added a new reference("Microsoft Web Browser"/"Schdocvw.dll"). Once i done that i fixed my problem easy, i dont know what to call this realy is it a bug or is there another way? gimme your thoughts guys


    ps: Im new Hi

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: .Net WebBrowser

    Hi. Welcome to the forums. What do you mean by "doesn't contain the URL of the new window being loaded"? Do you mean it opens up a new IE window with about:blank?

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    9

    Re: .Net WebBrowser

    Quote Originally Posted by mendhak
    Hi. Welcome to the forums. What do you mean by "doesn't contain the URL of the new window being loaded"? Do you mean it opens up a new IE window with about:blank?
    Well, It fires a new window. But doesnt contain the destination URL. My plan was to catch the windows and load it all in the same browser. (keeping it nice and simple in one window, Even for new links) But since the new window event doesnt contain the URL it causes me issues, as i can stop the window loading, but have no clue where to send the old one.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: .Net WebBrowser

    What are you using for this? VB or C# as this sounds mmore like a coding problem rather then a discussion on the framework?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: .Net WebBrowser

    How about handling the _Navigating() event? If you get the URL there, cancel it, and then send it off in the same browser window?

    Something like that at least, you only need to intercept the event, don't you?

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    9

    Re: .Net WebBrowser

    Quote Originally Posted by mendhak
    How about handling the _Navigating() event? If you get the URL there, cancel it, and then send it off in the same browser window?

    Something like that at least, you only need to intercept the event, don't you?
    Navigating() event doesnt contain weather its a new window or not..

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: .Net WebBrowser

    But if you always handle it, you don't really need to know if it's a new window or not, as long as you can intercept the URL?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width