Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Create Axwebbrowser with new Tabpage (VS2005)

Create Axwebbrowser with new Tabpage (VS2005)

Scheduled Pinned Locked Moved C#
questioncsharpgraphicsdebugginghelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cola1973
    wrote on last edited by
    #1

    Hi , I am a beginner in C# and just looking for a function to create dynamic several Webbrowser in a Tabpage. I use the Microsoft Webbrowser AxSHDocVw.AxWebBrowser Control in my application. If i invoke the void a firsttime it runs, but at the second click I get a errormessage Exception Typ : System.Windows.Forms.AxHost+InvalidActiveXStateException This is my Code:

    void myTabPageAxWebbbrowser()
            {
                TabPage myTabPg = new TabPage();
                AxSHDocVw.AxWebBrowser myWB = new AxSHDocVw.AxWebBrowser();
                object empty = System.Reflection.Missing.Value;
                System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
                myTabPg.SuspendLayout();
    
                this.tabControl1.Controls.Add(myTabPg);
                myTabPg.Controls.Add(myWB);
                myTabPg.Location = new System.Drawing.Point(10, 30);
                myTabPg.Name = "MyNewPage";
                myTabPg.Padding = new System.Windows.Forms.Padding(3);
                myTabPg.Size = new System.Drawing.Size(650, 500);
                myTabPg.TabIndex = 1;
                myTabPg.Text = "MyNewTab";
                myTabPg.UseVisualStyleBackColor = true;
                myTabPg.ResumeLayout(false);
                myWB.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("myWB.OcxState")));
                myWB.Dock = System.Windows.Forms.DockStyle.Fill;
                Debug.WriteLine(myWB.OcxState.ToString());
                            
                myWB.Navigate("c:\\test.doc", ref empty, ref empty, ref empty, ref empty);//
    
            }
    
    Does anybody know how can I solve the Problem?
    
    
    
    Thanks in Advance
    
    Cola 1973  :)
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups