Search code examples
c#awesomium

How can I change parent's form webControl source on child form?


I'm using a webControl (awesomium) on my Form1.

When application starts (form1) it shows a second form (Form2).

Form2 form2 = new Form2();
form2.ShowDialog();

Then I execute a method of form2 and it closes automatically.

Well.. I'm stucked here! I want to set Form1 webControl1.Source = new Uri("http://www.example.com/"); when Form2 is closing..

How can I do that?


Solution

    1. Expose webcontrol as property of Form1

      public WebControl MyWebControl { get; set; }

    2. In form 2 you can access it as

      Form1 f1= new Form1();
      f1.MyWebControl.xyz =pqr;