Change document outline dynamically

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-04-22T09:37:42Z Indexed on 2010/04/22 10:13 UTC
Read the original article Hit count: 218

Filed under:
|

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 ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms