Roland Andreas
Roland Andreas

Reputation: 355

DevExpress TabbedView : Create Child Form from a Child Form

I'm using DX 15.1, and I'm trying to create a new tab from a child form.

So, basically, I have a parent form called "pForm", and a child form called "cForm". I'm using DocumentManager module and switched it to TabbedView mode.

When I'm trying to create a new tab from pForm, it's totally fine.

the problem is, when I'm can't create a new tab from cForm into pForm's TabbedView.

How do I achieve this? Thanks, mate :)

UPDATE : @DmitryG, thanks for your response. I've attached a screenshot below. The MDI-Parent is the RGP page with a settings header. and the MDI-Child is the Class Attendance form (popped-up window, triggered by a button inside the RGP form).

Can you give a solution, how to make the Class Attendance Form (mdi-child) became a new Tab beside RGP tab when it's triggered by a button within mdi-parent? Not as a popped-up window.

thanks!

TabbedView

Upvotes: 0

Views: 1300

Answers (1)

DmitryG
DmitryG

Reputation: 17850

When the DocumentManager works in MDI Mode you can just work with mdi parent and child forms. So, I believe, you code for adding a new mdi-child into mdi-parent form can looks like this:

static void AddMdiChildFromMdiParent(Form mdiParent) {
    Form child = new Form();
    child.MdiParent = mdiParent;
    child.Show();
}

Within the mdi-parent form you can call this code like this:

AddMdiChildFromMdiParent(this);

To add a new mdi-child from an existing mdi-child you can reuse the code above as follows:

static void AddMdiChildFromMdiChild(Form child) {
    AddMdiChildFromMdiParent(child.MdiParent);
}

Upvotes: 1

Related Questions