JasperX 0 Newbie Poster

I dont know if someone Use this Browser FrameWork , i hope so :)
I would use this Browser Framework in my Winform Application c#.
I have some questions to do. I'm getting Crazy :(
My target is Build a Tabbed WebBrowser with this FrameWork in a WinApps Form.

Question 1)
I just Saw the Documentation HERE

So i would use thisMethod

I just create a new Class and a new Awesomium.Windows.Forms.WebControl Object.

Now if i use it without any particulary method (just the ones to create object and Load the Url Source it works. But when i want use This method :

browser.SetHeaderDefinition("MyHeader", myCol); //myCol is a NameValueCollection

i recive this error `The control is disabled either manually or it has been destroyed.`

On the first page that i linked there is wrote :

------------------------------------------------------------------------------------
In addition to its regular meaning, the Enabled property has a special meaning in WebControl: it also indicates if the underlying view is valid and enabled.

A WebControl is considered invalid when it has been destroyed (by either calling Close() or Shutdown()) or was never properly instantiated.

Manually setting the Enabled property to true, will temporarily render the control disabled.

....
....

While disabled (either because the view is destroyed or because you manually set this property) attempting to access members of this control, may cause a InvalidOperationException (see the documentation of each member).
-------------------------------------------------------------------------------

Now i tried to play with the *ENABLED property* but i still get this error. What i have to do to resolve this problem? I really didn't understand.

Awesomium.Windows.Forms.WebControl browser = 
                                            new Awesomium.Windows.Forms.WebControl();
                        this.SuspendLayout();
            browser.Location = new System.Drawing.Point(1, 12);
           browser.Name = "webControl1";
           browser.Size = new System.Drawing.Size(624, 442);
         browser.Source = new System.Uri("http://www.google.it", System.UriKind.Absolute);
                        browser.TabIndex = 0;
    **** This below is the code that i cant use cause i get the error control
    // System.Collections.Specialized.NameValueCollection myCol = 
    // new System.Collections.Specialized.NameValueCollection();
    //            myCol.Add("Referer", "http://www.yahoo.com");
    //            browser.SetHeaderDefinition("MyHeader", myCol);
    //            browser.AddHeaderRewriteRule("http://*", "MyHeader");

Question 2)

void AddTab(string url)
        {
  Awesomium.Windows.Forms.WebControl web = new Awesomium.Windows.Forms.WebControl();
          //  WebBrowser web = new WebBrowser();
            TabPage tab2 = new TabPage();
            tab2.Controls.Add(web);
            web.TabIndex = 0;
            web.Size = new System.Drawing.Size(624, 442);
            tabControl1.Controls.Add(tab2);
            tabControl1.SelectedTab = tab2;
         //   web.Navigate(url);
            web.Source = new System.Uri(url, System.UriKind.Absolute);
          }

With this code i create a very simple addTab method. I have another problem (?!?) becouse if i use (as see in comment code) WebBrowser instead of Awesomium is start and i can Write in the google for example anything with Keyboard. Instead if i use Awesomium i cant insert anything in the google search. While i use it without Tab Control i can write in google search correctly.

Question 3)
After i didnt resolve question 1 i tried to do in another way.
Use WebView(According to API the WebView should be a Tab of Chrome) instead Awesomium WebControl.
So is possibile create a Tabbed with this Object? The problem is that WebView isnt a Control so i cant add to a TabControl.

I hope that someone could help me. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.