Search code examples
c#visual-studio-2010awesomium

Displaying a form within another form


I am building a web browser application using c# and the awesomium web framework . I have a form containing a dock panel within which I would like to display another form that holds the awesomium web-control . Basically the parent form facilitates creating tabs and the one with the webControl has the browsing engine and is rendered within the tabs .

Is this possible ? If yes , can you give me some tips on how to.


Solution

  • You can embed a form in another control if set TopLevel = false;

    private void EmbedForm()
    {
        Form f = new Form();
        f.TopLevel = false;
        f.BackColor = Color.White;
        f.FormBorderStyle = FormBorderStyle.None;
        f.Dock = DockStyle.Fill;
        f.Visible = true;
        panel1.Controls.Add(f);
    }