Saiesh
Saiesh

Reputation: 641

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.

Upvotes: 2

Views: 235

Answers (2)

Amen Ayach
Amen Ayach

Reputation: 4348

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);
}

Upvotes: 2

asktomsk
asktomsk

Reputation: 2298

Move common UI content to UserControl and use it in a both form. It is a most common practice.

Upvotes: 1

Related Questions