Print Page | Close Window

DockingPaneManager State

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=14821
Printed Date: 29 April 2024 at 7:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DockingPaneManager State
Posted By: martin.kelley
Subject: DockingPaneManager State
Date Posted: 24 July 2009 at 5:37am
Hi. I am using v13 ActiveX from c#
I am trying to save the layout of the Panes on my form and restore them when the form is next loaded
In my FormClosed event I have
 
DockingPaneGlobalSettings glob = new DockingPaneGlobalSettings();
PropExchange pEx=glob.CreatePropExchange();
DockingPaneLayout myLayout=DockingPaneManager.CreateLayout();
DockingPaneManager.GetLayout(myLayout);
pEx.CreateAsXML(false, "MaintenanceItem");
myLayout.DoPropExchange(pEx);
pEx.SaveToFile(@"c:\Test.xml");
 
In my FormLoad event (at the very end) I have
DockingPaneGlobalSettings globSettings=new DockingPaneGlobalSettings();
PropExchange pEx = globSettings.CreatePropExchange();
DockingPaneLayout myLayout=DockingPaneManager.CreateLayout();
pEx.CreateAsXML(true,"MaintenanceItem");
if(pEx.LoadFromFile(@"c:\Test.xml"))
{
  myLayout.DoPropExchange(pEx);
  DockingPaneManager.SetLayout(myLayout);
}
 
The file is saved and seems to relect the state of the panes. But the state of the panes is not restored by the code I have in FormLoad
 
What am I missing?   The SaveStae and LoadState methods seem to have the same problem; a registry entry is made but
Loading it seems to have no effect on the Pane layout.
 
Thanks



Replies:
Posted By: Kavian
Date Posted: 02 February 2012 at 8:07pm
Public Sub DockingPanes_Load(objdp As DockingPane)
    Dim px As PropExchange
    Set px = XtremeDockingPane.CreatePropExchange()
    px.CreateAsXML True, "DPSettings"
    If (px.LoadFromFile(App.Path & "dp.xml")) Then
        objdp.DestroyAll
        objdp.Layout.DoPropExchange px
    End If
    objdp.RecalcLayout
End Sub
 
Public Sub DockingPanes_Save(objdp As DockingPane)
    Dim px As PropExchange
    Set px = XtremeDockingPane.CreatePropExchange()
    px.CreateAsXML False, "DPSettings"
    objdp.Layout.DoPropExchange px
    px.SaveToFile App.Path & "dp.xml"
End Sub



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net