Page 3 of 3 FirstFirst 123
Results 81 to 100 of 100

Thread: [RESOLVED] WebBrowser Tabs

  1. #81
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    Quote Originally Posted by pillhead2007 View Post
    A first chance exception of type 'System.NullReferenceException' occurred in Web Browser.exe
    A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll
    See #77 - these aren't errors being raised in your application, just in the .net framework. They can be resolved but basically they aren't going to stop your code running, unlike a runtime exception within your own code.

    There is an option to turn off these messages somewhere but I can't recall where off the top of my head.

  2. #82

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    no worries anyways thanks for helping me but im just gonna give up on tabs and it get it back running again

  3. #83
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    Quote Originally Posted by pillhead2007 View Post
    no worries anyways thanks for helping me but im just gonna give up on tabs and it get it back running again
    I have created a new project with a new form containing 6 buttons called button 1 to button 6, a combo box called combobox1, a tab control called tabcontrol1 with 1 page called tabpage1, and 2 timer controls called timer1 and timer2.

    Then I pasted in the code that you provided above in post #61, and changed the webbrowser1 references to ActiveBrowser in buttons1 -6, deleted that line that caused the infinite loop, and ran the code :

    All works fine, with multiple tabs

    (thats a slight fib - there is one more line that needs adding to get it working perfectly, but that is unrelated to webbrowser1 not working) :

    Code:
            Dim X As New TabPage
            X.Text = "My New Page "
            TabControl1.TabPages.Add(X)
            Dim Y As New WebBrowser
            Y.Dock = DockStyle.Fill
            AddHandler Y.Navigated, AddressOf WebBrowser1_Navigated
            AddHandler Y.DocumentCompleted, AddressOf WebBrowser1_DocumentCompleted
    
            X.Controls.Add(Y)

  4. #84

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    copy code and ill make a new project see if it works then

  5. #85
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    Let me know if you want a copy of the project so you can try running it yourself and compare what I had with what you have.

  6. #86

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    yea please do that

  7. #87
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    Here it is.

    Note obviously I don't have your graphics on the buttons so you'll need to work out what each one does, and I've moved the code to create a new tab into a 7th button on the side of the tab control
    Attached Files Attached Files

  8. #88

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    thanks ive added some rep for u for being patient an understanding :>

  9. #89

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    thats good that erm is there a code to remove ur tabs once done with them ??

  10. #90
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    No problem... do you think you understand the process of creating controls dynamically now?

    Creating a control in code like we did with "Dim Y as New WebBrowser" is exactly what Visual Studio does for you behind the scenes when your create a control via the designer. There is a hidden file associated with every form which just consists of code exactly like that - to see it you click on the "Show All Files" button in the Solution explorer toolbar and then click on the "+" icon that appears next to your form and then you will see a Form1.Designer.Vb icon - double click that and you'll see the code that VB has generated for you automatically to create the controls.

  11. #91
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    I'll leave you to work out how to remove a tab... will be a good exercise for you!

  12. #92

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    yay followed your project and mine worked ermm just got one slight problem tho
    Code:
    Try
    
                ActiveBrowser.Navigate(New Uri(address))
            Catch ex As System.UriFormatException
                Stop
                Return
            End Try
    How do I get that Stop comming Up In yellow when i deburg it
    it says this on me immediate window on error console
    A first chance exception of type 'System.NullReferenceException' occurred in Web Browser 2.exe

  13. #93
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    The command "STOP" breaks execution of your code at that point and opens the debugger. I put it in there because you are just ignoring possible exceptions that might be important - the fact that it is running that line suggests there is a problem somewhere. It may be that you just want to ignore it, in which case just remove that line.

    And as I said before "A first chance exception of type 'System.NullReferenceException' occurred in Web Browser 2.exe" is not an error in your code necessarily.

    See http://blogs.msdn.com/davidklinems/a...12/438061.aspx for an explanation about these "first chance exceptions"

  14. #94

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    yea i took out that line and it comes up for all these listed in yellow too
    But Me First tab Wont Work With All these errors
    ActiveBrowser.Stop()
    ActiveBrowser.GoForward()
    ActiveBrowser.GoBack()
    ActiveBrowser.Refresh()
    ActiveBrowser.GoHome()
    ActiveBrowser.Navigate(ComboBox1.Text)

  15. #95
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    Sorry you'll need to be more specific. Do you get these "yellow" lines in the project I gave you or just your own?

    I have no idea what you mean by

    But Me First tab Wont Work With All these errors
    ActiveBrowser.Stop()
    ActiveBrowser.GoForward()
    ActiveBrowser.GoBack()
    ActiveBrowser.Refresh()
    ActiveBrowser.GoHome()
    ActiveBrowser.Navigate(ComboBox1.Text)
    I don't mean to appear rude but you need to be very precise and specific if you want someone to work out what is happening, vague statements just don't give any meaningful information.

  16. #96

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs


  17. #97

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    and its appearing not work the first tab page

  18. #98
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: WebBrowser Tabs

    Does the problem occur with my version, or just in your version? I don't get the problem in the code I sent you.

    If it only occurs in your version then I think its something to do with your initial form setup.

    I've tried on the version - specifically testing button5 - that I sent you and it seems to be working OK.

    It may be worth taking the project I sent you and adding your graphics into that version and re-arranging the controls to suit, rather than persisting with your project as it sounds like something has gone wrong in the setup of the form you created.

  19. #99

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    okies its fine now thanks dude u know hot set it so when the program runs it runs straight to full screen
    ??

  20. #100

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: WebBrowser Tabs

    dont matter done it thanks

Page 3 of 3 FirstFirst 123

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