I have a code
    void SomeButton_Click(object sender, EventArgs e)
    {
            if (this.Controls.Contains(Panel2))
            {
                this.Controls.Remove(Panel2);
            }
            else
            {
                this.Controls.Add(Panel2);
            }
    }
My problem is: the code changes document outline order of controls on my form. How can I restore previous document outline ? What properties, methods should I use ? Or is it impossible ?