I have an MDI application where I have a parent Form and several open child forms as shown in the image.
the opening sequence of the children forms was: form1 form2 form3 form4
Then I change the order of the forms interposing them in different ways, but when I scroll through the children forms showing a message for each iteration, they do not show me the current order as they are in the image, the following order is always shown as they were created Initially:
form1 form2 form3 form4
instead of that, what I want is to be shown in the following order as the image:
form1 form3 form2 form4
some idea of how to get it
my code is on the button of the child form:
private void button1_Click(object sender, EventArgs e)
{
for (int x = 0; x <= MdiParent.MdiChildren.Count() - 1; x++) {
MessageBox.Show(MdiParent.MdiChildren[x].Text);
}
}
Thank you very much!