Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
DockableControlPane Visibility
posted

I have a bunch of DockableControlPanes that I've made with the designer.  At times I need to change which pane is on top (like when in a group and only one is visible at one time, I might need to change this on the fly).  The problem is the panes generated in the designer are declared AND instatiated in the InitializeComponents.  Most all windows/infragistics controls I've seen put the declaration outside the InitializeComponents so I can access them using this.dockableControlPane1 etc...  I don't want to edit designer code as it will just be rewritten.  Is there somewhere in the designer I can tell it to put the declaration outside the InitializeComponents method? 

  • 44743
    Verified Answer
    posted

    You cannot change what is stored as a local variable in the InitializeComponent method and what is declared as a member variable for design-time serialized components. However, it is easy enough to get back to these DockableControlPanes from the UltraDockManager member variable. They are all contained in the ControlPanes collection. This collection can be accessed by index or by the Control in the pane.  Also, if you prefer to access them through member variables, you can declare and store the member variables manually after the InitializeComponent call in the constructor of the Form:

     public class Form1:Form

    {

    private DockableControlPane paneForPanel1;

    public Form1()

    {

        this.InitializeComponent();

        this.paneForPanel1 = this.ultraDockManager.ControlPanes[this.panel1];
    }

    }