Hi,
On opening the application.
i have a button which will open a child window(user control).
now i docked that child window to the dockmanager.
i used SaveAsXml to save the dock setting .
when again i start the application,the child window that was docked was not initialized to the last save position.
please help me on this
regards,
sid
No, there is no way to check for this. My guess is you want to know whether it was present so you don't see the docked control on the Form when it wasn't loaded as a pane, is this correct? If that is the case, you can add a Panel control to you Form and set its Visible property to False. Then you can add the dock control to this panel. You will not see it on the Form, but it will still be found by the loading logic.
Hi Mike,
Thanks for the idea.
Now i am facing one more problem.
Now i am able to load the user control from the xml.
Before closing the application i closed the docked form.
Now when i again reopen the application that form is getting docked
is there any flag in the xml file which we can check whether that pane was previously present or not
when i am checking the xml file that pane name is present in the file.
When loading a layout with LoadFromXml, the loaded DockableControlPanes have a control name loaded with them. The loading logic then tries to find a control somewhere on the Form which has the same name. If it finds one, it puts it in the loaded pane. If it doesn't find one, the pane is destroyed. So when you create your UserControl to show as a pane, make sure to set its Name property to a unique value. Then before you load your layout file, create another UserControl and give it the same Name property. Add the UserControl to the Form (or any control nested in the Form) and then call LoadFromXml.